chance-generators
Advanced tools
Comparing version
@@ -16,15 +16,22 @@ "use strict"; | ||
var getMagicValuesSet = function getMagicValuesSet() { | ||
return (typeof global === "undefined" ? "undefined" : _typeof(global)) === "object" && global.recordLocation && global.recordLocation.magicValues; | ||
}; | ||
var getMagicValues = function getMagicValues() { | ||
return (typeof global === "undefined" ? "undefined" : _typeof(global)) === "object" && global.recordLocation && global.recordLocation.magicValues || []; | ||
var magicValuesSet = getMagicValuesSet(); | ||
return magicValuesSet && Array.from(magicValuesSet) || []; | ||
}; | ||
var invalidateCacheIfNecessary = function invalidateCacheIfNecessary() { | ||
var magicValues = getMagicValues(); | ||
var isCacheInvalid = cacheBase.size !== magicValues.length || cacheBase.magicValues !== magicValues; | ||
var magicValuesSet = getMagicValuesSet(); | ||
var isCacheInvalid = !magicValuesSet || cacheBase.size !== magicValuesSet.size || cacheBase.magicValuesSet !== magicValuesSet; | ||
if (isCacheInvalid) { | ||
cache = {}; | ||
cacheBase = { | ||
magicValues: magicValues, | ||
size: magicValues.length | ||
magicValuesSet: magicValuesSet, | ||
size: magicValuesSet ? magicValuesSet.size : 0 | ||
}; | ||
@@ -31,0 +38,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "lib/index.js", | ||
@@ -33,2 +33,3 @@ "files": [ | ||
"eslint-config-pretty-standard": "0.2.2", | ||
"imocha": "0.3.0", | ||
"istanbul": "0.4.2", | ||
@@ -41,3 +42,3 @@ "javascript-state-machine": "2.3.5", | ||
"prettier-package-json": "1.4.0", | ||
"serve": "6.5.8", | ||
"serve": "9.4.2", | ||
"unexpected": "10.37.1", | ||
@@ -44,0 +45,0 @@ "unexpected-documentation-site-generator": "4.6.1", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%161527
-13.56%21
5%55
-3.51%3187
-17.73%