@ninetailed/experience.js 2.0.0-beta.29 → 2.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +3 -3
- package/index.umd.js +3 -2
- package/lib/experience/index.d.ts +1 -0
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -3240,6 +3240,8 @@ const selectVariant$1 = (baseline, variants, {
|
|
|
3240
3240
|
};
|
|
3241
3241
|
};
|
|
3242
3242
|
|
|
3243
|
+
const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
|
|
3244
|
+
|
|
3243
3245
|
const selectBaselineWithVariants = (experience, baseline) => {
|
|
3244
3246
|
return experience.components.find(baselineWithVariants => baselineWithVariants.baseline.id === baseline.id);
|
|
3245
3247
|
};
|
|
@@ -3862,8 +3864,6 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
3862
3864
|
];
|
|
3863
3865
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
3864
3866
|
|
|
3865
|
-
const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
|
|
3866
|
-
|
|
3867
3867
|
const selectActiveExperiments = (experiments, profile) => {
|
|
3868
3868
|
const experimentTraits = pickBy(profile.traits, (value, key) => key.startsWith(EXPERIENCE_TRAIT_PREFIX) && value === true);
|
|
3869
3869
|
const experimentTraitsIds = Object.keys(experimentTraits).map(id => id.replace(EXPERIENCE_TRAIT_PREFIX, '')); // a experiment is active when the use has it set as a true value on the traits and the experiment config is still active
|
|
@@ -4338,4 +4338,4 @@ const decodeExperienceVariantsMap = encodedExperienceVariantsMap => {
|
|
|
4338
4338
|
}), {});
|
|
4339
4339
|
};
|
|
4340
4340
|
|
|
4341
|
-
export { index as Cache, NINETAILED_TRACKER_EVENTS, Ninetailed, PLUGIN_NAME, decodeExperienceVariantsMap, isExperienceMatch, ninetailedPlugin, selectActiveExperiments, selectDistribution, selectEligibleExperiences, selectExperience, selectBaselineWithVariants as selectExperienceBaselineWithVariants, selectVariant as selectExperienceVariant, selectVariants as selectExperienceVariants, selectHasVariants as selectHasExperienceVariants, selectVariant$1 as selectVariant };
|
|
4341
|
+
export { index as Cache, EXPERIENCE_TRAIT_PREFIX, NINETAILED_TRACKER_EVENTS, Ninetailed, PLUGIN_NAME, decodeExperienceVariantsMap, isExperienceMatch, ninetailedPlugin, selectActiveExperiments, selectDistribution, selectEligibleExperiences, selectExperience, selectBaselineWithVariants as selectExperienceBaselineWithVariants, selectVariant as selectExperienceVariant, selectVariants as selectExperienceVariants, selectHasVariants as selectHasExperienceVariants, selectVariant$1 as selectVariant };
|
package/index.umd.js
CHANGED
|
@@ -3044,6 +3044,8 @@
|
|
|
3044
3044
|
};
|
|
3045
3045
|
};
|
|
3046
3046
|
|
|
3047
|
+
var EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
|
|
3048
|
+
|
|
3047
3049
|
var selectBaselineWithVariants = function selectBaselineWithVariants(experience, baseline) {
|
|
3048
3050
|
return experience.components.find(function (baselineWithVariants) {
|
|
3049
3051
|
return baselineWithVariants.baseline.id === baseline.id;
|
|
@@ -3775,8 +3777,6 @@
|
|
|
3775
3777
|
];
|
|
3776
3778
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
3777
3779
|
|
|
3778
|
-
var EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
|
|
3779
|
-
|
|
3780
3780
|
var selectActiveExperiments = function selectActiveExperiments(experiments, profile) {
|
|
3781
3781
|
var experimentTraits = pickBy__default["default"](profile.traits, function (value, key) {
|
|
3782
3782
|
return key.startsWith(EXPERIENCE_TRAIT_PREFIX) && value === true;
|
|
@@ -4269,6 +4269,7 @@
|
|
|
4269
4269
|
};
|
|
4270
4270
|
|
|
4271
4271
|
exports.Cache = index;
|
|
4272
|
+
exports.EXPERIENCE_TRAIT_PREFIX = EXPERIENCE_TRAIT_PREFIX;
|
|
4272
4273
|
exports.NINETAILED_TRACKER_EVENTS = NINETAILED_TRACKER_EVENTS;
|
|
4273
4274
|
exports.Ninetailed = Ninetailed;
|
|
4274
4275
|
exports.PLUGIN_NAME = PLUGIN_NAME;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './types';
|
|
2
|
+
export { EXPERIENCE_TRAIT_PREFIX } from './constants';
|
|
2
3
|
export { selectBaselineWithVariants as selectExperienceBaselineWithVariants } from './selectBaselineWithVariants';
|
|
3
4
|
export { selectVariants as selectExperienceVariants } from './selectVariants';
|
|
4
5
|
export { selectHasVariants as selectHasExperienceVariants } from './selectHasVariants';
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.31",
|
|
4
4
|
"main": "./index.umd.js",
|
|
5
5
|
"module": "./index.esm.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"analytics": "^0.8.0",
|
|
9
|
-
"@ninetailed/experience.js-shared": "2.0.0-beta.
|
|
9
|
+
"@ninetailed/experience.js-shared": "2.0.0-beta.31",
|
|
10
10
|
"uuid": "^8.3.2",
|
|
11
11
|
"ts-toolbelt": "^9.6.0",
|
|
12
12
|
"locale-enum": "^1.1.1",
|