summaryrefslogtreecommitdiff
path: root/node_modules/evaluate-value
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/evaluate-value')
-rw-r--r--node_modules/evaluate-value/LICENSE21
-rw-r--r--node_modules/evaluate-value/README.md41
-rw-r--r--node_modules/evaluate-value/index-es5.js17
-rw-r--r--node_modules/evaluate-value/index-es5.js.map1
-rw-r--r--node_modules/evaluate-value/index.js17
-rw-r--r--node_modules/evaluate-value/package.json33
6 files changed, 130 insertions, 0 deletions
diff --git a/node_modules/evaluate-value/LICENSE b/node_modules/evaluate-value/LICENSE
new file mode 100644
index 0000000..274147a
--- /dev/null
+++ b/node_modules/evaluate-value/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Steven Vachon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/evaluate-value/README.md b/node_modules/evaluate-value/README.md
new file mode 100644
index 0000000..8f835bb
--- /dev/null
+++ b/node_modules/evaluate-value/README.md
@@ -0,0 +1,41 @@
+# 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.
+* When the first input argument is *not* a function, it is simply returned.
+
+
+## Installation
+
+[Node.js](http://nodejs.org/) `>= 8` is required. To install, type this at the command line:
+```shell
+npm install evaluate-value
+```
+
+
+## Usage
+
+```js
+const evaluateValue = require('evaluate-value');
+
+evaluateValue(true);
+//-> true
+
+evaluateValue(() => true);
+//-> true
+
+evaluateValue(
+ (arg1, arg2) => arg1 === arg2,
+ true,
+ false
+);
+//-> false
+```
+
+
+[npm-image]: https://img.shields.io/npm/v/evaluate-value.svg
+[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
diff --git a/node_modules/evaluate-value/index-es5.js b/node_modules/evaluate-value/index-es5.js
new file mode 100644
index 0000000..bb24dae
--- /dev/null
+++ b/node_modules/evaluate-value/index-es5.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var evaluateValue = function evaluateValue(value) {
+ if (typeof value === "function") {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ return value.apply(void 0, args);
+ }
+
+ return value;
+};
+
+module.exports = evaluateValue;
+
+//# sourceMappingURL=index-es5.js.map \ No newline at end of file
diff --git a/node_modules/evaluate-value/index-es5.js.map b/node_modules/evaluate-value/index-es5.js.map
new file mode 100644
index 0000000..feb7428
--- /dev/null
+++ b/node_modules/evaluate-value/index-es5.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["index.js"],"names":[],"mappings":"AAAA;;AAIA,IAAM,aAAa,GAAG,SAAhB,aAAgB,CAAC,KAAD,EACtB;AACC,MAAI,OAAO,KAAP,KAAiB,UAArB,EACA;AAAA,sCAHgC,IAGhC;AAHgC,MAAA,IAGhC;AAAA;;AACC,WAAO,KAAK,MAAL,SAAS,IAAT,CAAP;AACA;;AAED,SAAO,KAAP;AACA,CARD;;AAYA,MAAM,CAAC,OAAP,GAAiB,aAAjB","file":"index-es5.js","sourcesContent":["\"use strict\";\n\n\n\nconst evaluateValue = (value, ...args) =>\n{\n\tif (typeof value === \"function\")\n\t{\n\t\treturn value(...args);\n\t}\n\n\treturn value;\n};\n\n\n\nmodule.exports = evaluateValue;\n"]} \ No newline at end of file
diff --git a/node_modules/evaluate-value/index.js b/node_modules/evaluate-value/index.js
new file mode 100644
index 0000000..7ee35b0
--- /dev/null
+++ b/node_modules/evaluate-value/index.js
@@ -0,0 +1,17 @@
+"use strict";
+
+
+
+const evaluateValue = (value, ...args) =>
+{
+ if (typeof value === "function")
+ {
+ return value(...args);
+ }
+
+ return value;
+};
+
+
+
+module.exports = evaluateValue;
diff --git a/node_modules/evaluate-value/package.json b/node_modules/evaluate-value/package.json
new file mode 100644
index 0000000..6e068d1
--- /dev/null
+++ b/node_modules/evaluate-value/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "evaluate-value",
+ "description": "Return a value or an evaluated function (with arguments).",
+ "version": "2.0.0",
+ "license": "MIT",
+ "author": "Steven Vachon <contact@svachon.com> (https://svachon.com)",
+ "browser": "index-es5.js",
+ "repository": "github:stevenvachon/evaluate-value",
+ "devDependencies": {
+ "@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": ">= 8"
+ },
+ "scripts": {
+ "prepublishOnly": "npm test && babel index.js --out-file=index-es5.js --presets=@babel/env --source-maps",
+ "test": "mocha test.js --check-leaks --bail"
+ },
+ "files": [
+ "index.js",
+ "index-es5.js",
+ "index-es5.js.map"
+ ],
+ "keywords": [
+ "function",
+ "options",
+ "value"
+ ]
+}