This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
inkletblot-com-v1/node_modules/setprototypeof
2019-12-02 12:10:45 +10:30
..
test initial commit 2019-12-02 12:10:45 +10:30
index.d.ts initial commit 2019-12-02 12:10:45 +10:30
index.js initial commit 2019-12-02 12:10:45 +10:30
LICENSE initial commit 2019-12-02 12:10:45 +10:30
package.json initial commit 2019-12-02 12:10:45 +10:30
README.md initial commit 2019-12-02 12:10:45 +10:30

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 = require('setprototypeof')