|
|
il y a 10 mois | |
|---|---|---|
| .. | ||
| test | il y a 10 mois | |
| LICENSE | il y a 10 mois | |
| README.md | il y a 10 mois | |
| index.d.ts | il y a 10 mois | |
| index.js | il y a 10 mois | |
| package.json | il y a 10 mois | |
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 setprototypeof
var setPrototypeOf = require('setprototypeof')
var obj = {}
setPrototypeOf(obj, {
foo: function () {
return 'bar'
}
})
obj.foo() // bar
TypeScript is also supported:
import setPrototypeOf from 'setprototypeof'