landing-page-experiments
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StatsigABHelper=e():t.StatsigABHelper=e()}(self,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>o});const o=class{static getCookie(t){const e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]+)"));if(e)return e[2]}static setCookie(t,e){document.cookie=`${t}=${e}; max-age=31536000; path=/`}static getStableID(){const t="statsig_stable_id";let e=this.getCookie(t);return e||(e=Date.now().toString(36)+Math.random().toString(36).substring(2),this.setCookie(t,e)),e}static getExperimentConfig(t,e){return o=this,n=void 0,r=function*(){const o=this.getStableID(),n=yield fetch("https://featuregates.org/v1/get_config",{method:"POST",headers:{"Content-Type":"application/json","statsig-api-key":t},body:JSON.stringify({user:{userId:o,customIDs:{stableID:o}},configName:e})});if(n.ok)return yield n.json()},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{s(r.next(t))}catch(t){e(t)}}function c(t){try{s(r.throw(t))}catch(t){e(t)}}function s(e){var o;e.done?t(e.value):(o=e.value,o instanceof i?o:new i((function(t){t(o)}))).then(a,c)}s((r=r.apply(o,n||[])).next())}));var o,n,i,r}static redirectToUrl(t){const e=new URL(window.location.href),o=new URL(t,window.location.href);e.pathname!=o.pathname&&window.location.replace(t)}static performRedirect(t,e){this.getExperimentConfig(t,e).then((t=>{var e;const o=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.page_url;o&&this.redirectToUrl(o)})).catch((t=>{console.log(t)}))}};return e.default})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StatsigABHelper=e():t.StatsigABHelper=e()}(self,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>o});class o{static getCookie(t){const e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]+)"));if(e)return e[2]}static setCookie(t,e){document.cookie=`${t}=${e}; max-age=31536000; path=/`}static getStableID(){const t="statsig_stable_id";let e=this.getCookie(t);return e||(e=Date.now().toString(36)+Math.random().toString(36).substring(2),this.setCookie(t,e)),e}static getExperimentConfig(t,e){return o=this,n=void 0,r=function*(){const o=this.getStableID(),n=yield fetch("https://featuregates.org/v1/get_config",{method:"POST",headers:{"Content-Type":"application/json","statsig-api-key":t},body:JSON.stringify({user:{userId:o,customIDs:{stableID:o}},configName:e})});if(n.ok)return yield n.json()},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{c(r.next(t))}catch(t){e(t)}}function s(t){try{c(r.throw(t))}catch(t){e(t)}}function c(e){var o;e.done?t(e.value):(o=e.value,o instanceof i?o:new i((function(t){t(o)}))).then(a,s)}c((r=r.apply(o,n||[])).next())}));var o,n,i,r}static redirectToUrl(t){const e=new URL(window.location.href),o=new URL(t,window.location.href);e.pathname!=o.pathname&&window.location.replace(t)}static performRedirect(t,e){this.getExperimentConfig(t,e).then((t=>{var e;const o=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.page_url;o&&this.redirectToUrl(o)})).catch((t=>{console.log(t)}))}}return window.StatsigABHelper=o,e.default})())); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "landing-page-experiments", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Statsig helps run landing page experiments by redirecting users to two or more landing pages based on an ABn Test.", | ||
@@ -5,0 +5,0 @@ "jsdelivr": "dist/index.js", |
@@ -1,2 +0,2 @@ | ||
export default class { | ||
export default class StatsigABHelper { | ||
static getCookie(name: string) { | ||
@@ -76,1 +76,3 @@ const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); | ||
} | ||
window["StatsigABHelper"] = StatsigABHelper; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11854