![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | test/ | 2 years ago | - | |
![]() | LICENSE | 39 years ago | 727 | |
![]() | README.md | 39 years ago | 844 | |
![]() | index.d.ts | 39 years ago | 93 | |
![]() | index.js | 39 years ago | 407 | |
![]() | package.json | 2 years ago | 2.2K |
Object.setPrototypeOf
A 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 setprototypeof
var setPrototypeOf = require('setprototypeof')
var obj = {}
setPrototypeOf(obj, {
foo: function () {
return 'bar'
}
})
obj.foo() // bar
TypeScript is also supported:
import setPrototypeOf from 'setprototypeof'