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
    24,431,224
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    24,431,224
  • 1.1.1
    3,902,313
  • 1.1.0
    11,720,711
  • 1.0.3
    457,474
  • 1.0.2
    95,400
  • 1.0.1
    883
  • 1.0.0
    667

Package Sidebar

Install

npm i setprototypeof

Weekly Downloads

40,608,672

Version

1.2.0

License

ISC

Unpacked Size

4.03 kB

Total Files

6

Last publish

Collaborators

  • wesleytodd