JSPM

  • Created
  • Published
  • Downloads 5921
  • Score
    100M100P100Q137485F
  • License MIT

ES6-compliant shim for RequireObjectCoercible.

Package Exports

  • require-object-coercible-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 (require-object-coercible-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

require-object-coercible-x

ES6-compliant shim for RequireObjectCoercible.

See: 7.2.1 RequireObjectCoercible ( argument )

module.exports(value)string

The abstract operation RequireObjectCoercible throws an error if argument is a value that cannot be converted to an Object using ToObject.

Kind: Exported function
Returns: string - The value.
Throws:

  • TypeError If value is a null or undefined.
Param Type Description
value * The value to check.

Example

import RequireObjectCoercible from 'require-object-coercible-x';

RequireObjectCoercible(); // TypeError
RequireObjectCoercible(null); // TypeError
console.log(RequireObjectCoercible('abc')); // 'abc'
console.log(RequireObjectCoercible(true)); // true
console.log(RequireObjectCoercible(Symbol('foo'))); // Symbol('foo')