configcat-common
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -148,3 +148,3 @@ "use strict"; | ||
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () { | ||
var value, variationId, numberString; | ||
var value, variationId, numberString, modulo; | ||
return __generator(this, function (_a) { | ||
@@ -155,3 +155,3 @@ switch (_a.label) { | ||
value = _a.sent(); | ||
variationId = key + '-'; | ||
variationId = key + '_'; | ||
if (value === null || value === undefined) { | ||
@@ -166,8 +166,11 @@ variationId += 'null'; | ||
case 'number': | ||
numberString = value < 0 ? '-' : ''; | ||
numberString += Math.trunc(value); | ||
if (value % 1 !== 0) { | ||
numberString += '.' + Math.trunc((value % 1) * 1000000); | ||
numberString = '' + Math.trunc(value); | ||
modulo = Math.abs(value % 1); | ||
if (modulo) { | ||
numberString += '.' + Math.trunc((modulo) * 1000000); | ||
while (numberString.charAt(numberString.length - 1) === '0') { | ||
numberString = numberString.substring(0, numberString.length - 1); | ||
} | ||
} | ||
variationId += sha1(numberString); | ||
variationId += numberString; | ||
break; | ||
@@ -174,0 +177,0 @@ default: |
{ | ||
"name": "configcat-common", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
59520
1255