JSPM

evaluate-value

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 79117
  • Score
    100M100P100Q159198F
  • License MIT

Return a value or an evaluated function (with arguments).

Package Exports

  • evaluate-value

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (evaluate-value) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

evaluate-value NPM Version Build Status

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 >= 8 is required. To install, type this at the command line:

npm install evaluate-value

Usage

const evaluateValue = require('evaluate-value');

evaluateValue(true);
//-> true

evaluateValue(() => true);
//-> true

evaluateValue(
  (arg1, arg2) => arg1 === arg2,
  true,
  false
);
//-> false