expf-sigma-node.js 3.2.2 → 3.2.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/sigma.js +10 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expf-sigma-node.js",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
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
@@ -903,7 +903,7 @@ function compareVersions(versionA, versionB, strict = true) {
903
903
  }
904
904
 
905
905
  // src/helpers/conditionOperation.js
906
- function conditionOperation(userValue, conditionValues, operation) {
906
+ function conditionOperation(userValue, conditionValues, operation, date, time) {
907
907
  !operation ? operation = "=" : operation;
908
908
  if (userValue === null || typeof userValue === "undefined" || !conditionValues)
909
909
  return false;
@@ -944,11 +944,11 @@ function conditionOperation(userValue, conditionValues, operation) {
944
944
  case "on date":
945
945
  return Math.floor(
946
946
  new Date(conditionValues.trim()).getTime() / (1e3 * 60 * 60 * 24)
947
- ) == this.sigmaUserData.user.date;
947
+ ) == date;
948
948
  case "after time":
949
- return new Date(conditionValues.trim()).getTime() / (1e3 * 60 * 60) < this.sigmaUserData.user.time;
949
+ return new Date(conditionValues.trim()).getTime() / (1e3 * 60 * 60) < time;
950
950
  case "before time":
951
- return new Date(conditionValues.trim()).getTime() / (1e3 * 60 * 60) > this.sigmaUserData.user.time;
951
+ return new Date(conditionValues.trim()).getTime() / (1e3 * 60 * 60) > time;
952
952
  case "starts with":
953
953
  return userValue.startsWith(conditionValues);
954
954
  case "not starts with":
@@ -1404,7 +1404,9 @@ var Sigma = class {
1404
1404
  conditionOperation(
1405
1405
  userValue,
1406
1406
  targets.conditions[index].value,
1407
- targets.conditions[index].condition_sign
1407
+ targets.conditions[index].condition_sign,
1408
+ this.sigmaUserData.user.data,
1409
+ this.sigmaUserData.user.time
1408
1410
  )
1409
1411
  );
1410
1412
  }
@@ -1616,7 +1618,9 @@ var Sigma = class {
1616
1618
  conditionOperation(
1617
1619
  userValue,
1618
1620
  conditions[i].value,
1619
- conditions[i].condition_sign
1621
+ conditions[i].condition_sign,
1622
+ this.sigmaUserData.user.data,
1623
+ this.sigmaUserData.user.time
1620
1624
  )
1621
1625
  );
1622
1626
  }