Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

setprototypeof

1.1.0 • Public • Published

Polyfill for 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.

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');

install

npm i setprototypeof

Downloadsweekly downloads

8,848,007

version

1.1.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability