to-object-x
ES6-compliant shim for ToObject.
See: 7.1.13 ToObject ( argument )
Version: 1.5.0
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:
TypeErrorIfvalueis anullorundefined.
| 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'))