expf-sigma-node.js 0.1.5 → 0.1.7
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/package.json +1 -1
- package/public/sigma.js +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expf-sigma-node.js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "expf-sigma-node.js lets you manage features flags and remote config across web, server side applications. Deliver true Continuous Integration. Get builds out faster. Control who has access to new features.",
|
|
5
5
|
"main": "public/sigma.js",
|
|
6
6
|
"keywords": [
|
package/public/sigma.js
CHANGED
|
@@ -6089,6 +6089,10 @@ var Sigma = class {
|
|
|
6089
6089
|
const geoData = await this.cache.parse("sigmaGeoData");
|
|
6090
6090
|
this.sigmaUserData.setGeo(geoData);
|
|
6091
6091
|
let flag = null;
|
|
6092
|
+
const expName = this.getExperimentByFeatureFlag(cacheKey, flagName);
|
|
6093
|
+
if (expName) {
|
|
6094
|
+
return await this.getExperiment(expName).then((res) => res.getFeatureValue(flagName));
|
|
6095
|
+
}
|
|
6092
6096
|
for (let i = 0; i < cacheKey.feature_flags.length; i++) {
|
|
6093
6097
|
if (cacheKey.feature_flags[i]["name"] === flagName) {
|
|
6094
6098
|
flag = cacheKey.feature_flags[i];
|
|
@@ -6099,6 +6103,18 @@ var Sigma = class {
|
|
|
6099
6103
|
return null;
|
|
6100
6104
|
return this.findingSpotCondition(flag, this.sigmaUserData);
|
|
6101
6105
|
}
|
|
6106
|
+
getExperimentByFeatureFlag(cache, flagName) {
|
|
6107
|
+
for (let i = 0; i < cache.experiments.length; i++) {
|
|
6108
|
+
if (cache.experiments[i].feature_flags.length) {
|
|
6109
|
+
for (let j in cache.experiments[i].feature_flags) {
|
|
6110
|
+
if (cache.experiments[i].feature_flags[j].name === flagName) {
|
|
6111
|
+
return cache.experiments[i].name;
|
|
6112
|
+
}
|
|
6113
|
+
}
|
|
6114
|
+
}
|
|
6115
|
+
}
|
|
6116
|
+
return null;
|
|
6117
|
+
}
|
|
6102
6118
|
getFlag(key) {
|
|
6103
6119
|
if (!key) {
|
|
6104
6120
|
return false;
|