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

evaluate-value

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evaluate-value - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

index-es5.js

28

package.json
{
"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
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