@guardian/ab-core
Advanced tools
Comparing version 0.2.1-alpha.14 to 0.2.1-alpha.19
@@ -1,2 +0,2 @@ | ||
function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var t=function(){},n=function(e,t){return t({abTestRegister:e})},r=function(e,t){var n={variantName:e.id,complete:t};return e.campaignCode&&(n.campaignCodes=[e.campaignCode]),n},i=function(e){return e.variants.every(function(e){return"function"==typeof e.impression})},s=function(e,i,s){return function(a){var u=a.variantToRun,o=(e?u.success:u.impression)||t;try{o(function(e,t,i,s){var a,u=((a={})[e.id]=r(t,i),a);return function(){return n(u,s)}}(a,u,e,s))}catch(e){i(e,{},!1)}}};exports.AB=function(){function t(t){var a=t.serverSideTests,u=t.errorReporter,o=t.ophanRecord,c=function(t){var n=t.mvtMaxValue,r=void 0===n?1e6:n,i=t.mvtId,s=t.pageIsSensitive,a=t.abTestSwitches,u=t.forcedTestVariant,o=t.forcedTestException,c=t.arrayOfTestObjects,f=void 0===c?[]:c,v=function(t){var n,c,f=function(e){var t=r*e.audienceOffset;return i&&i>t&&i<=t+r*e.audience?e.variants[i%e.variants.length]:null}(t),v=u&&u.testId===t.id&&u.variant||f;return o!==t.id&&function(e){var t,n=(t=e.expiry,(new Date).valueOf()>new Date(t).setHours(23,59,59,59)),r=!!e.showForSensitive,i=a[e.id]&&!!a[e.id],u=!e.canRun||e.canRun();return(!s||r)&&i&&!n&&u}(t)&&v&&(c="notintest"!==(n=v).id,n.canRun?n.canRun()&&c:c)?e({},t,{variantToRun:v}):null};return{runnableTest:v,firstRunnableTest:function(e){return e.map(function(e){return v(e)}).find(function(e){return null!==e})||null},isUserInVariant:function(e,t){return(n=f,n.reduce(function(e,t){var n=v(t);return n?[].concat(e,[n]):e},[])).some(function(n){return n.id===e&&n.variantToRun.id===t});var n}}}({mvtMaxValue:t.mvtMaxValue,mvtId:t.mvtId,pageIsSensitive:t.pageIsSensitive,abTestSwitches:t.abTestSwitches,forcedTestVariant:t.forcedTestVariant,forcedTestException:t.forcedTestException,arrayOfTestObjects:t.arrayOfTestObjects}),f=function(e){var t=e.serverSideTests,a=void 0===t?{}:t,u=e.errorReporter,o=void 0===u?function(){}:u,c=e.ophanRecord,f=void 0===c?function(){}:c;return{registerCompleteEvents:function(e){return e.forEach(s(!0,o,f))},registerImpressionEvents:function(e){return e.filter(i).forEach(s(!1,o,f))},trackABTests:function(e){return n(function(e,t,n){try{var s={},a=Object.keys(n).filter(function(e){return!!n[e]});return e.filter(function(e){return!i(e)}).forEach(function(e){s[e.id]=r(e.variantToRun,!1)}),a.forEach(function(e){s["ab"+e]=r({id:"inTest",test:function(){}},!1)}),s}catch(e){return t(e,{},!1),{}}}(e,o,a),f)}}}({serverSideTests:a,errorReporter:u,ophanRecord:o});this._firstRunnableTest=c.firstRunnableTest,this._runnableTest=c.runnableTest,this._isUserInVariant=c.isUserInVariant,this._registerCompleteEvents=f.registerCompleteEvents,this._registerImpressionEvents=f.registerImpressionEvents,this._trackABTests=f.trackABTests}var a;return(a=[{key:"firstRunnableTest",get:function(){return this._firstRunnableTest}},{key:"runnableTest",get:function(){return this._runnableTest}},{key:"isUserInVariant",get:function(){return this._isUserInVariant}},{key:"registerCompleteEvents",get:function(){return this._registerCompleteEvents}},{key:"registerImpressionEvents",get:function(){return this._registerImpressionEvents}},{key:"trackABTests",get:function(){return this._trackABTests}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,a),t}(); | ||
function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var t=function(){},n=function(e,t){return t({abTestRegister:e})},r=function(e,t){var n={variantName:e.id,complete:t};return e.campaignCode&&(n.campaignCodes=[e.campaignCode]),n},i=function(e){return e.variants.every(function(e){return"function"==typeof e.impression})},s=function(e,i,s){return function(a){var o=a.variantToRun,u=(e?o.success:o.impression)||t;try{u(function(e,t,i,s){var a,o=((a={})[e.id]=r(t,i),a);return function(){return n(o,s)}}(a,o,e,s))}catch(e){i(e,{},!1)}}};exports.AB=function(){function t(t){var a=t.serverSideTests,o=t.errorReporter,u=t.ophanRecord,c=function(t){var n=t.mvtMaxValue,r=void 0===n?1e6:n,i=t.mvtId,s=t.pageIsSensitive,a=t.abTestSwitches,o=t.forcedTestVariant,u=t.forcedTestException,c=t.arrayOfTestObjects,f=void 0===c?[]:c,v=function(e){var t,n=(t=e.expiry,(new Date).valueOf()>new Date(t).setHours(23,59,59,59)),r=!!e.showForSensitive,i=a["ab"+e.id]&&!!a["ab"+e.id],o=!e.canRun||e.canRun();return console.log({expired:n,pageIsSensitive:s,testShouldShowForSensitive:r,isTestOn:i,canTestBeRun:o,testCanRun:e.canRun()}),(!s||r)&&i&&!n&&o},l=function(t){var n,s,a=function(e){var t=r*e.audienceOffset;return i&&i>t&&i<=t+r*e.audience?e.variants[i%e.variants.length]:null}(t),c=o&&o.testId===t.id&&o.variant,f=u===t.id,l=c||a;return console.log({forcedOutOfTest:f,fromForcedTest:c,variantToRun:l,testCanBeRun:v(t)}),!f&&v(t)&&l&&(s="notintest"!==(n=l).id,n.canRun?n.canRun()&&s:s)?e({},t,{variantToRun:l}):null};return{runnableTest:l,firstRunnableTest:function(e){return e.map(function(e){return l(e)}).find(function(e){return null!==e})||null},isUserInVariant:function(e,t){return(n=f,n.reduce(function(e,t){var n=l(t);return n?[].concat(e,[n]):e},[])).some(function(n){return n.id===e&&n.variantToRun.id===t});var n}}}({mvtMaxValue:t.mvtMaxValue,mvtId:t.mvtId,pageIsSensitive:t.pageIsSensitive,abTestSwitches:t.abTestSwitches,forcedTestVariant:t.forcedTestVariant,forcedTestException:t.forcedTestException,arrayOfTestObjects:t.arrayOfTestObjects}),f=function(e){var t=e.serverSideTests,a=void 0===t?{}:t,o=e.errorReporter,u=void 0===o?function(){}:o,c=e.ophanRecord,f=void 0===c?function(){}:c;return{registerCompleteEvents:function(e){return e.forEach(s(!0,u,f))},registerImpressionEvents:function(e){return e.filter(i).forEach(s(!1,u,f))},trackABTests:function(e){return n(function(e,t,n){try{var s={},a=Object.keys(n).filter(function(e){return!!n[e]});return e.filter(function(e){return!i(e)}).forEach(function(e){s[e.id]=r(e.variantToRun,!1)}),a.forEach(function(e){s["ab"+e]=r({id:"inTest",test:function(){}},!1)}),s}catch(e){return t(e,{},!1),{}}}(e,u,a),f)}}}({serverSideTests:a,errorReporter:o,ophanRecord:u});this._firstRunnableTest=c.firstRunnableTest,this._runnableTest=c.runnableTest,this._isUserInVariant=c.isUserInVariant,this._registerCompleteEvents=f.registerCompleteEvents,this._registerImpressionEvents=f.registerImpressionEvents,this._trackABTests=f.trackABTests}var a;return(a=[{key:"firstRunnableTest",get:function(){return this._firstRunnableTest}},{key:"runnableTest",get:function(){return this._runnableTest}},{key:"isUserInVariant",get:function(){return this._isUserInVariant}},{key:"registerCompleteEvents",get:function(){return this._registerCompleteEvents}},{key:"registerImpressionEvents",get:function(){return this._registerImpressionEvents}},{key:"trackABTests",get:function(){return this._trackABTests}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,a),t}(); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
const e=()=>{},t=(e,t)=>t({abTestRegister:e}),r=(e,t)=>{const r={variantName:e.id,complete:t};return e.campaignCode&&(r.campaignCodes=[e.campaignCode]),r},s=e=>e.variants.every(e=>"function"==typeof e.impression),n=(s,n,i)=>a=>{const o=a.variantToRun,c=(s?o.success:o.impression)||e;try{c(((e,s,n,i)=>{const a={[e.id]:r(s,n)};return()=>t(a,i)})(a,o,s,i))}catch(e){n(e,{},!1)}};class i{constructor(e){const{mvtMaxValue:i,mvtId:a,pageIsSensitive:o,abTestSwitches:c,serverSideTests:u,forcedTestVariant:v,forcedTestException:T,errorReporter:d,ophanRecord:l,arrayOfTestObjects:p}=e,f=(e=>{const{mvtMaxValue:t=1e6,mvtId:r,pageIsSensitive:s,abTestSwitches:n,forcedTestVariant:i,forcedTestException:a,arrayOfTestObjects:o=[]}=e,c=e=>{const o=(e=>{const s=t*e.audienceOffset;return r&&r>s&&r<=s+t*e.audience?e.variants[r%e.variants.length]:null})(e),c=i&&i.testId===e.id&&i.variant||o;return a!==e.id&&(e=>{const t=(r=e.expiry,(new Date).valueOf()>new Date(r).setHours(23,59,59,59));var r;const i=!!e.showForSensitive,a=n[e.id]&&!!n[e.id],o=!e.canRun||e.canRun();return(!s||i)&&a&&!t&&o})(e)&&c&&(e=>{const t="notintest"!==e.id;return e.canRun?e.canRun()&&t:t})(c)?{...e,variantToRun:c}:null};return{runnableTest:c,firstRunnableTest:e=>e.map(e=>c(e)).find(e=>null!==e)||null,isUserInVariant:(e,t)=>{return(r=o,r.reduce((e,t)=>{const r=c(t);return r?[...e,r]:e},[])).some(r=>r.id===e&&r.variantToRun.id===t);var r}}})({mvtMaxValue:i,mvtId:a,pageIsSensitive:o,abTestSwitches:c,forcedTestVariant:v,forcedTestException:T,arrayOfTestObjects:p}),h=(e=>{const{serverSideTests:i={},errorReporter:a=(()=>{}),ophanRecord:o=(()=>{})}=e;return{registerCompleteEvents:e=>e.forEach(n(!0,a,o)),registerImpressionEvents:e=>e.filter(s).forEach(n(!1,a,o)),trackABTests:e=>t(((e,t,n)=>{try{const t={},i=Object.keys(n).filter(e=>!!n[e]);return e.filter(e=>!s(e)).forEach(e=>{t[e.id]=r(e.variantToRun,!1)}),i.forEach(e=>{t["ab"+e]=r({id:"inTest",test:()=>{}},!1)}),t}catch(e){return t(e,{},!1),{}}})(e,a,i),o)}})({serverSideTests:u,errorReporter:d,ophanRecord:l});this._firstRunnableTest=f.firstRunnableTest,this._runnableTest=f.runnableTest,this._isUserInVariant=f.isUserInVariant,this._registerCompleteEvents=h.registerCompleteEvents,this._registerImpressionEvents=h.registerImpressionEvents,this._trackABTests=h.trackABTests}get firstRunnableTest(){return this._firstRunnableTest}get runnableTest(){return this._runnableTest}get isUserInVariant(){return this._isUserInVariant}get registerCompleteEvents(){return this._registerCompleteEvents}get registerImpressionEvents(){return this._registerImpressionEvents}get trackABTests(){return this._trackABTests}}export{i as AB}; | ||
const e=()=>{},t=(e,t)=>t({abTestRegister:e}),s=(e,t)=>{const s={variantName:e.id,complete:t};return e.campaignCode&&(s.campaignCodes=[e.campaignCode]),s},r=e=>e.variants.every(e=>"function"==typeof e.impression),n=(r,n,a)=>i=>{const o=i.variantToRun,c=(r?o.success:o.impression)||e;try{c(((e,r,n,a)=>{const i={[e.id]:s(r,n)};return()=>t(i,a)})(i,o,r,a))}catch(e){n(e,{},!1)}};class a{constructor(e){const{mvtMaxValue:a,mvtId:i,pageIsSensitive:o,abTestSwitches:c,serverSideTests:u,forcedTestVariant:T,forcedTestException:v,errorReporter:d,ophanRecord:l,arrayOfTestObjects:p}=e,f=(e=>{const{mvtMaxValue:t=1e6,mvtId:s,pageIsSensitive:r,abTestSwitches:n,forcedTestVariant:a,forcedTestException:i,arrayOfTestObjects:o=[]}=e,c=e=>{const t=(s=e.expiry,(new Date).valueOf()>new Date(s).setHours(23,59,59,59));var s;const a=!!e.showForSensitive,i=n["ab"+e.id]&&!!n["ab"+e.id],o=!e.canRun||e.canRun();return console.log({expired:t,pageIsSensitive:r,testShouldShowForSensitive:a,isTestOn:i,canTestBeRun:o,testCanRun:e.canRun()}),(!r||a)&&i&&!t&&o},u=e=>{const r=(e=>{const r=t*e.audienceOffset;return s&&s>r&&s<=r+t*e.audience?e.variants[s%e.variants.length]:null})(e),n=a&&a.testId===e.id&&a.variant,o=i===e.id,u=n||r;return console.log({forcedOutOfTest:o,fromForcedTest:n,variantToRun:u,testCanBeRun:c(e)}),!o&&c(e)&&u&&(e=>{const t="notintest"!==e.id;return e.canRun?e.canRun()&&t:t})(u)?{...e,variantToRun:u}:null};return{runnableTest:u,firstRunnableTest:e=>e.map(e=>u(e)).find(e=>null!==e)||null,isUserInVariant:(e,t)=>{return(s=o,s.reduce((e,t)=>{const s=u(t);return s?[...e,s]:e},[])).some(s=>s.id===e&&s.variantToRun.id===t);var s}}})({mvtMaxValue:a,mvtId:i,pageIsSensitive:o,abTestSwitches:c,forcedTestVariant:T,forcedTestException:v,arrayOfTestObjects:p}),h=(e=>{const{serverSideTests:a={},errorReporter:i=(()=>{}),ophanRecord:o=(()=>{})}=e;return{registerCompleteEvents:e=>e.forEach(n(!0,i,o)),registerImpressionEvents:e=>e.filter(r).forEach(n(!1,i,o)),trackABTests:e=>t(((e,t,n)=>{try{const t={},a=Object.keys(n).filter(e=>!!n[e]);return e.filter(e=>!r(e)).forEach(e=>{t[e.id]=s(e.variantToRun,!1)}),a.forEach(e=>{t["ab"+e]=s({id:"inTest",test:()=>{}},!1)}),t}catch(e){return t(e,{},!1),{}}})(e,i,a),o)}})({serverSideTests:u,errorReporter:d,ophanRecord:l});this._firstRunnableTest=f.firstRunnableTest,this._runnableTest=f.runnableTest,this._isUserInVariant=f.isUserInVariant,this._registerCompleteEvents=h.registerCompleteEvents,this._registerImpressionEvents=h.registerImpressionEvents,this._trackABTests=h.trackABTests}get firstRunnableTest(){return this._firstRunnableTest}get runnableTest(){return this._runnableTest}get isUserInVariant(){return this._isUserInVariant}get registerCompleteEvents(){return this._registerCompleteEvents}get registerImpressionEvents(){return this._registerImpressionEvents}get trackABTests(){return this._trackABTests}}export{a as AB}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).abCore={})}(this,function(e){function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var n=function(){},r=function(e,t){return t({abTestRegister:e})},i=function(e,t){var n={variantName:e.id,complete:t};return e.campaignCode&&(n.campaignCodes=[e.campaignCode]),n},s=function(e){return e.variants.every(function(e){return"function"==typeof e.impression})},a=function(e,t,s){return function(a){var o=a.variantToRun,u=(e?o.success:o.impression)||n;try{u(function(e,t,n,s){var a,o=((a={})[e.id]=i(t,n),a);return function(){return r(o,s)}}(a,o,e,s))}catch(e){t(e,{},!1)}}};e.AB=function(){function e(e){var n=e.serverSideTests,o=e.errorReporter,u=e.ophanRecord,c=function(e){var n=e.mvtMaxValue,r=void 0===n?1e6:n,i=e.mvtId,s=e.pageIsSensitive,a=e.abTestSwitches,o=e.forcedTestVariant,u=e.forcedTestException,c=e.arrayOfTestObjects,f=void 0===c?[]:c,v=function(e){var n,c,f=function(e){var t=r*e.audienceOffset;return i&&i>t&&i<=t+r*e.audience?e.variants[i%e.variants.length]:null}(e),v=o&&o.testId===e.id&&o.variant||f;return u!==e.id&&function(e){var t,n=(t=e.expiry,(new Date).valueOf()>new Date(t).setHours(23,59,59,59)),r=!!e.showForSensitive,i=a[e.id]&&!!a[e.id],o=!e.canRun||e.canRun();return(!s||r)&&i&&!n&&o}(e)&&v&&(c="notintest"!==(n=v).id,n.canRun?n.canRun()&&c:c)?t({},e,{variantToRun:v}):null};return{runnableTest:v,firstRunnableTest:function(e){return e.map(function(e){return v(e)}).find(function(e){return null!==e})||null},isUserInVariant:function(e,t){return(n=f,n.reduce(function(e,t){var n=v(t);return n?[].concat(e,[n]):e},[])).some(function(n){return n.id===e&&n.variantToRun.id===t});var n}}}({mvtMaxValue:e.mvtMaxValue,mvtId:e.mvtId,pageIsSensitive:e.pageIsSensitive,abTestSwitches:e.abTestSwitches,forcedTestVariant:e.forcedTestVariant,forcedTestException:e.forcedTestException,arrayOfTestObjects:e.arrayOfTestObjects}),f=function(e){var t=e.serverSideTests,n=void 0===t?{}:t,o=e.errorReporter,u=void 0===o?function(){}:o,c=e.ophanRecord,f=void 0===c?function(){}:c;return{registerCompleteEvents:function(e){return e.forEach(a(!0,u,f))},registerImpressionEvents:function(e){return e.filter(s).forEach(a(!1,u,f))},trackABTests:function(e){return r(function(e,t,n){try{var r={},a=Object.keys(n).filter(function(e){return!!n[e]});return e.filter(function(e){return!s(e)}).forEach(function(e){r[e.id]=i(e.variantToRun,!1)}),a.forEach(function(e){r["ab"+e]=i({id:"inTest",test:function(){}},!1)}),r}catch(e){return t(e,{},!1),{}}}(e,u,n),f)}}}({serverSideTests:n,errorReporter:o,ophanRecord:u});this._firstRunnableTest=c.firstRunnableTest,this._runnableTest=c.runnableTest,this._isUserInVariant=c.isUserInVariant,this._registerCompleteEvents=f.registerCompleteEvents,this._registerImpressionEvents=f.registerImpressionEvents,this._trackABTests=f.trackABTests}var n;return(n=[{key:"firstRunnableTest",get:function(){return this._firstRunnableTest}},{key:"runnableTest",get:function(){return this._runnableTest}},{key:"isUserInVariant",get:function(){return this._isUserInVariant}},{key:"registerCompleteEvents",get:function(){return this._registerCompleteEvents}},{key:"registerImpressionEvents",get:function(){return this._registerImpressionEvents}},{key:"trackABTests",get:function(){return this._trackABTests}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,n),e}()}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).abCore={})}(this,function(e){function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var n=function(){},r=function(e,t){return t({abTestRegister:e})},i=function(e,t){var n={variantName:e.id,complete:t};return e.campaignCode&&(n.campaignCodes=[e.campaignCode]),n},s=function(e){return e.variants.every(function(e){return"function"==typeof e.impression})},a=function(e,t,s){return function(a){var o=a.variantToRun,u=(e?o.success:o.impression)||n;try{u(function(e,t,n,s){var a,o=((a={})[e.id]=i(t,n),a);return function(){return r(o,s)}}(a,o,e,s))}catch(e){t(e,{},!1)}}};e.AB=function(){function e(e){var n=e.serverSideTests,o=e.errorReporter,u=e.ophanRecord,c=function(e){var n=e.mvtMaxValue,r=void 0===n?1e6:n,i=e.mvtId,s=e.pageIsSensitive,a=e.abTestSwitches,o=e.forcedTestVariant,u=e.forcedTestException,c=e.arrayOfTestObjects,f=void 0===c?[]:c,v=function(e){var t,n=(t=e.expiry,(new Date).valueOf()>new Date(t).setHours(23,59,59,59)),r=!!e.showForSensitive,i=a["ab"+e.id]&&!!a["ab"+e.id],o=!e.canRun||e.canRun();return console.log({expired:n,pageIsSensitive:s,testShouldShowForSensitive:r,isTestOn:i,canTestBeRun:o,testCanRun:e.canRun()}),(!s||r)&&i&&!n&&o},d=function(e){var n,s,a=function(e){var t=r*e.audienceOffset;return i&&i>t&&i<=t+r*e.audience?e.variants[i%e.variants.length]:null}(e),c=o&&o.testId===e.id&&o.variant,f=u===e.id,d=c||a;return console.log({forcedOutOfTest:f,fromForcedTest:c,variantToRun:d,testCanBeRun:v(e)}),!f&&v(e)&&d&&(s="notintest"!==(n=d).id,n.canRun?n.canRun()&&s:s)?t({},e,{variantToRun:d}):null};return{runnableTest:d,firstRunnableTest:function(e){return e.map(function(e){return d(e)}).find(function(e){return null!==e})||null},isUserInVariant:function(e,t){return(n=f,n.reduce(function(e,t){var n=d(t);return n?[].concat(e,[n]):e},[])).some(function(n){return n.id===e&&n.variantToRun.id===t});var n}}}({mvtMaxValue:e.mvtMaxValue,mvtId:e.mvtId,pageIsSensitive:e.pageIsSensitive,abTestSwitches:e.abTestSwitches,forcedTestVariant:e.forcedTestVariant,forcedTestException:e.forcedTestException,arrayOfTestObjects:e.arrayOfTestObjects}),f=function(e){var t=e.serverSideTests,n=void 0===t?{}:t,o=e.errorReporter,u=void 0===o?function(){}:o,c=e.ophanRecord,f=void 0===c?function(){}:c;return{registerCompleteEvents:function(e){return e.forEach(a(!0,u,f))},registerImpressionEvents:function(e){return e.filter(s).forEach(a(!1,u,f))},trackABTests:function(e){return r(function(e,t,n){try{var r={},a=Object.keys(n).filter(function(e){return!!n[e]});return e.filter(function(e){return!s(e)}).forEach(function(e){r[e.id]=i(e.variantToRun,!1)}),a.forEach(function(e){r["ab"+e]=i({id:"inTest",test:function(){}},!1)}),r}catch(e){return t(e,{},!1),{}}}(e,u,n),f)}}}({serverSideTests:n,errorReporter:o,ophanRecord:u});this._firstRunnableTest=c.firstRunnableTest,this._runnableTest=c.runnableTest,this._isUserInVariant=c.isUserInVariant,this._registerCompleteEvents=f.registerCompleteEvents,this._registerImpressionEvents=f.registerImpressionEvents,this._trackABTests=f.trackABTests}var n;return(n=[{key:"firstRunnableTest",get:function(){return this._firstRunnableTest}},{key:"runnableTest",get:function(){return this._runnableTest}},{key:"isUserInVariant",get:function(){return this._isUserInVariant}},{key:"registerCompleteEvents",get:function(){return this._registerCompleteEvents}},{key:"registerImpressionEvents",get:function(){return this._registerImpressionEvents}},{key:"trackABTests",get:function(){return this._trackABTests}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,n),e}()}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"version": "0.2.1-alpha.14+9e9f12d", | ||
"version": "0.2.1-alpha.19+13b1cbc", | ||
"name": "@guardian/ab-core", | ||
@@ -77,3 +77,3 @@ "author": "The Guardian", | ||
}, | ||
"gitHead": "9e9f12df9e43cdc0200c922fe467321187554173" | ||
"gitHead": "13b1cbcd2fd92af0b372f1401303070cec5ad12d" | ||
} |
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
81903
221