package
A small polyfill for Object.setprototypeof
npm install setprototypeofGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
3.9 kB
Includes dependencies.
Object.setPrototypeOfA simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8.
$ npm install --save setprototypeofvar setPrototypeOf = require('setprototypeof')
var obj = {}
setPrototypeOf(obj, {
foo: function () {
return 'bar'
}
})
obj.foo() // barTypeScript is also supported:
import setPrototypeOf from 'setprototypeof'