MicroCommunityWeb/node_modules/setprototypeof
2021-04-23 10:14:20 +08:00
..
index.d.ts 优化代码 2021-04-23 10:14:20 +08:00
index.js 优化代码 2021-04-23 10:14:20 +08:00
LICENSE 优化代码 2021-04-23 10:14:20 +08:00
package.json 优化代码 2021-04-23 10:14:20 +08:00
README.md 优化代码 2021-04-23 10:14:20 +08:00

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