evaluate-value
Advanced tools
Comparing version 1.0.2 to 2.0.0
{ | ||
"name": "evaluate-value", | ||
"description": "Return a value or an evaluated function (with arguments).", | ||
"version": "1.0.2", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"author": "Steven Vachon <contact@svachon.com> (https://www.svachon.com/)", | ||
"main": "lib", | ||
"repository": "stevenvachon/evaluate-value", | ||
"author": "Steven Vachon <contact@svachon.com> (https://svachon.com)", | ||
"browser": "index-es5.js", | ||
"repository": "github:stevenvachon/evaluate-value", | ||
"devDependencies": { | ||
"babel-cli": "^6.23.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"chai": "^3.5.0", | ||
"mocha": "^3.2.0" | ||
"@babel/cli": "^7.4.3", | ||
"@babel/core": "^7.4.3", | ||
"@babel/preset-env": "^7.4.3", | ||
"chai": "^4.2.0", | ||
"mocha": "^6.1.4" | ||
}, | ||
"engines": { | ||
"node": ">= 4" | ||
"node": ">= 8" | ||
}, | ||
"scripts": { | ||
"build": "babel src --out-dir=lib --presets=es2015", | ||
"prepublish": "npm test", | ||
"test": "npm run build && mocha test --reporter spec --check-leaks --bail" | ||
"prepublishOnly": "npm test && babel index.js --out-file=index-es5.js --presets=@babel/env --source-maps", | ||
"test": "mocha test.js --check-leaks --bail" | ||
}, | ||
"files": [ | ||
"lib" | ||
"index.js", | ||
"index-es5.js", | ||
"index-es5.js.map" | ||
], | ||
@@ -26,0 +28,0 @@ "keywords": [ |
# evaluate-value [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] | ||
> Return a value or an evaluated function (with arguments). | ||
* When the first input argument is a function, it is executed with the remaining arguments, and the result is returned. | ||
@@ -10,3 +12,3 @@ * When the first input argument is *not* a function, it is simply returned. | ||
[Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line: | ||
[Node.js](http://nodejs.org/) `>= 8` is required. To install, type this at the command line: | ||
```shell | ||
@@ -23,13 +25,13 @@ npm install evaluate-value | ||
evaluateValue(true); | ||
// true | ||
//-> true | ||
evaluateValue(function() { | ||
return true | ||
}); | ||
// true | ||
evaluateValue(() => true); | ||
//-> true | ||
evaluateValue(function(arg1, arg2) { | ||
return arg1 === arg2; | ||
}, true, false); | ||
// false | ||
evaluateValue( | ||
(arg1, arg2) => arg1 === arg2, | ||
true, | ||
false | ||
); | ||
//-> false | ||
``` | ||
@@ -39,4 +41,4 @@ | ||
[npm-image]: https://img.shields.io/npm/v/evaluate-value.svg | ||
[npm-url]: https://npmjs.org/package/evaluate-value | ||
[npm-url]: https://npmjs.com/package/evaluate-value | ||
[travis-image]: https://img.shields.io/travis/stevenvachon/evaluate-value.svg | ||
[travis-url]: https://travis-ci.org/stevenvachon/evaluate-value |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4007
6
21
42
0
5