xprezzo-setprototypeof

1.1.2 • Public • Published

xprezzo-setprototypeof

Object.setPrototypeOf() is in the ECMAScript 2015 specification. NodeJS starts implement Object.setPrototypeOf since version 0.12.0. NodeJS starts from 0.10.0 before 0.12.0 was using Object.prototype.__proto__.

xprezzo-setprototypeof is a polyfill for Object.setPrototypeOf.

The setprototypeof is extending directly on the xprezzo-mixin

Usage:

For more ussages, please visit xprezzo-mixin.

$ npm install --save xprezzo-setprototypeof
const setPrototypeOf = require('setprototypeof')

let obj = {}
setPrototypeOf(obj, {
  foo: function () {
    return 'bar'
  }
})
obj.foo() // bar

TypeScript is also supported:

import setPrototypeOf from 'setprototypeof'

People

Xprezzo and related projects are maintained by Cloudgen Wong.

License

MIT

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

npm i xprezzo-setprototypeof

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

3.68 kB

Total Files

6

Last publish

Collaborators

  • xprezzo