lhl 6ff0e96ad3 8-4-1 1 year ago
..
test 6ff0e96ad3 8-4-1 1 year ago
LICENSE 6ff0e96ad3 8-4-1 1 year ago
README.md 6ff0e96ad3 8-4-1 1 year ago
index.d.ts 6ff0e96ad3 8-4-1 1 year ago
index.js 6ff0e96ad3 8-4-1 1 year ago
package.json 6ff0e96ad3 8-4-1 1 year ago

README.md

Polyfill for Object.setPrototypeOf

NPM Version NPM Downloads js-standard-style

A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8.

Usage:

$ 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'