JSPM

  • Created
  • Published
  • Downloads 11500
  • Score
    100M100P100Q122489F
  • License MIT

ES6-compliant shim for ToObject.

Package Exports

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

Readme

to-object-x

Travis status Dependency status devDependency status npm version

ES6-compliant shim for ToObject.

Requires ES3 or above.

See: 7.1.13 ToObject ( argument )
Version: 1.1.1
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

module.exports(value)Object

The abstract operation ToObject converts argument to a value of type Object.

Kind: Exported function
Returns: Object - The value converted to an object.
Throws:

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

Example

var ToObject = require('to-object-x');

ToObject(); // TypeError
ToObject(null); // TypeError
ToObject('abc'); // Object('abc')
ToObject(true); // Object(true)
ToObject(Symbol('foo')); // Object(Symbol('foo'))