Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chance-generators

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chance-generators - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

17

lib/magicValues.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc