setprototypeof
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    27,113,391
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    27,113,391
  • 1.1.1
    4,478,551
  • 1.1.0
    13,308,324
  • 1.0.3
    530,233
  • 1.0.2
    118,445
  • 1.0.1
    1,302
  • 1.0.0
    861

Package Sidebar

Install

npm i setprototypeof

Weekly Downloads

45,551,107

Version

1.2.0

License

ISC

Unpacked Size

4.03 kB

Total Files

6

Last publish

Collaborators

  • wesleytodd