JSPM

  • Created
  • Published
  • Downloads 12255
  • Score
    100M100P100Q128960F
  • License MIT

Converts argument to a value of type Boolean.

Package Exports

  • to-boolean-x

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 (to-boolean-x) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

to-boolean-x

Converts argument to a value of type Boolean.

module.exports(value)boolean

The abstract operation ToBoolean converts argument to a value of type Boolean.

Kind: Exported function
Returns: boolean - 'true' if value is truthy; otherwise 'false'.

Param Type Description
value * The value to be converted.

Example

import toBoolean from 'to-boolean-x';

console.log(toBoolean(null)); // false
console.log(toBoolean('')); // false
console.log(toBoolean(1)); // true
console.log(toBoolean('0')); // true