chance-generators
Advanced tools
Comparing version 3.5.2 to 3.5.3
@@ -37,3 +37,3 @@ "use strict"; | ||
value: function shrink(item) { | ||
if (this.lastUnwrappedValue === item && this.lastValue.shrink) { | ||
if (this.lastUnwrappedValue === item && this.lastValue && this.lastValue.shrink) { | ||
return this.lastValue.shrink(item); | ||
@@ -47,3 +47,3 @@ } else { | ||
value: function expand(item) { | ||
var expandableItem = this.lastUnwrappedValue === item && this.lastValue.expand; | ||
var expandableItem = this.lastUnwrappedValue === item && this.lastValue && this.lastValue.expand; | ||
@@ -50,0 +50,0 @@ return new WeightedGenerator([[this, 10], [expandableItem ? this.lastValue.expand(item) : item, 15]]); |
@@ -36,2 +36,6 @@ "use strict"; | ||
}); | ||
it("does not break when the generator emits falsy values", function () { | ||
new PickoneGenerator([null]).shrink().first(); | ||
}); | ||
}); | ||
@@ -43,2 +47,6 @@ | ||
}); | ||
it("does not break when the generator emits falsy values", function () { | ||
new PickoneGenerator([null]).expand().first(); | ||
}); | ||
}); | ||
@@ -45,0 +53,0 @@ |
{ | ||
"name": "chance-generators", | ||
"description": "Random generators based on changejs", | ||
"license": "MIT", | ||
"author": "Sune Simonsen", | ||
"license": "MIT", | ||
"version": "3.5.2", | ||
"version": "3.5.3", | ||
"main": "lib/index.js", | ||
@@ -20,3 +20,2 @@ "files": [ | ||
"test": "mocha ./documentation/**/*.md ./src/**/*.js ./test/**/*.js", | ||
"travis": "npm run lint && npm run coverage && npm run build", | ||
"update-examples": "generate-site --require ./bootstrap-unexpected-markdown.js --update-examples", | ||
@@ -36,3 +35,3 @@ "postversion": "npm run changelog && git add CHANGELOG.md && git commit --allow-empty -m 'Update changelog' && deploy-site.sh" | ||
"eslint": "^3.19.0", | ||
"eslint-config-pretty-standard": "^0.2.2", | ||
"eslint-config-pretty-standard": "^1.0.0", | ||
"imocha": "^0.3.0", | ||
@@ -47,3 +46,3 @@ "istanbul": "^0.4.2", | ||
"prettier-package-json": "^1.4.0", | ||
"serve": "^9.4.2", | ||
"serve": "^13.0.2", | ||
"unexpected": "^10.37.1", | ||
@@ -57,17 +56,3 @@ "unexpected-documentation-site-generator": "^4.6.1", | ||
"testing" | ||
], | ||
"lint-staged": { | ||
"linters": { | ||
"*.js": [ | ||
"eslint", | ||
"prettier --write", | ||
"git add" | ||
], | ||
"package.json": [ | ||
"prettier-package-json --write", | ||
"git add" | ||
] | ||
} | ||
}, | ||
"pre-commit": "lint-staged" | ||
] | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3718
0
186640
63