setprototypeof

A small polyfill for Object.setprototypeof

ISC 7 个版本
安装
npm install setprototypeof
yarn add setprototypeof
pnpm add setprototypeof
bun add setprototypeof
README

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'
版本列表
1.2.0 2019-07-18
1.1.1 2019-01-04
1.1.0 2017-09-13
1.0.3 2017-02-20
1.0.2 2016-11-13
1.0.1 2016-02-06
1.0.0 2015-02-04