This library exports a collection of bound native virtual methods - static methods of JavaScript standard built-in objects in their bound form - so that they can be used together with the proposed bind operator.
Install
$ npm install bound-native-methods
Usage
import*from'bound-native-methods';
// Or, be more specific and cut down the build size: //
Most static methods have been exported as is, but a few have been renamed or excluded to better fit the context:
Object
Native Form
Bound Form
Object.getPrototypeOf()
::getPrototype()
Object.setPrototypeOf()
::setPrototype()
Symbol
Native Form
Bound Form
Symbol.for()
::toSymbol() [1]
Symbol.keyFor()
::key()
Number
Native Form
Bound Form
Number.parseFloat()
::toFloat() [1]
Number.parseInt()
::toInt() [1]
Math
Native Form
Bound Form
Math.pow() [2]
×
Math.random()
×
Date
Native Form
Bound Form
Date.UTC()
×
Date.now()
×
Date.parse()
::toUnixOffset() [1]
Array
Native Form
Bound Form
Array.from()
×
Array.of()
×
ArrayBuffer
JSON
Native Form
Bound Form
JSON.parse()
::toObject() [1]
JSON.stringify()
::toJSON() [1]
Notes:
Bound methods whose names start with "to..." are to be applied to strings (with the exception of ::toJSON() which can be applied to a variety of data types)