Bakhtina Sofya b84cb877be 1st comm | 2 недель назад | |
---|---|---|
.. | ||
test | 2 недель назад | |
LICENSE | 2 недель назад | |
README.md | 2 недель назад | |
index.d.ts | 2 недель назад | |
index.js | 2 недель назад | |
package.json | 2 недель назад |
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'