chance-generators
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -25,3 +25,2 @@ "use strict"; | ||
this.seed = seed == null ? Math.round(Math.random() * 10000) : seed; | ||
this.context = {}; | ||
if (skipSeedCache) { | ||
@@ -39,3 +38,2 @@ this.chance = new Chance(seed); | ||
this.generator = this.generator.shrink(value); | ||
this.context = {}; | ||
this.isShrinkable = Boolean(this.generator.shrink); | ||
@@ -49,3 +47,2 @@ } | ||
this.generator = this.generator.expand(value); | ||
this.context = {}; | ||
this.isExpandable = Boolean(this.generator.expand); | ||
@@ -66,3 +63,3 @@ } | ||
value: function next() { | ||
return this.generator.generate(this.chance, this.context); | ||
return this.generator.generate(this.chance); | ||
} | ||
@@ -69,0 +66,0 @@ }]); |
@@ -9,3 +9,2 @@ "use strict"; | ||
var FloatingGenerator = require("./FloatingGenerator"); | ||
var Generator = require("./Generator"); | ||
var IntegerGenerator = require("./IntegerGenerator"); | ||
@@ -19,3 +18,2 @@ var MagicFloatingGenerator = require("./MagicFloatingGenerator"); | ||
var PicksetGenerator = require("./PicksetGenerator"); | ||
var Producer = require("./Producer"); | ||
var SequenceGenerator = require("./SequenceGenerator"); | ||
@@ -97,3 +95,3 @@ var ShapeGenerator = require("./ShapeGenerator"); | ||
text: createGeneratorFacade(TextGenerator), | ||
producer: function producer() { | ||
unique: function unique() { | ||
for (var _len9 = arguments.length, args = Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { | ||
@@ -103,5 +101,5 @@ args[_key9] = arguments[_key9]; | ||
return new (Function.prototype.bind.apply(Producer, [null].concat(args)))(); | ||
return new (Function.prototype.bind.apply(UniqueGenerator, [null].concat(args)))(); | ||
}, | ||
unique: function unique() { | ||
weighted: function weighted() { | ||
for (var _len10 = arguments.length, args = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { | ||
@@ -111,12 +109,4 @@ args[_key10] = arguments[_key10]; | ||
return new (Function.prototype.bind.apply(UniqueGenerator, [null].concat(args)))(); | ||
}, | ||
weighted: function weighted() { | ||
for (var _len11 = arguments.length, args = Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { | ||
args[_key11] = arguments[_key11]; | ||
} | ||
return new (Function.prototype.bind.apply(WeightedGenerator, [null].concat(args)))(); | ||
}, | ||
Generator: Generator | ||
} | ||
}; | ||
@@ -123,0 +113,0 @@ |
@@ -23,3 +23,3 @@ "use strict"; | ||
return magicValuesSet && (Array.isArray(magicValuesSet) ? [].concat(magicValuesSet) : Array.from(magicValuesSet)) || []; | ||
return magicValuesSet && Array.from(magicValuesSet) || []; | ||
}; | ||
@@ -26,0 +26,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"main": "lib/index.js", | ||
@@ -9,0 +9,0 @@ "files": [ |
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
165266
3246