Files
node-js-test/node_modules/setprototypeof
Mark 96ccf86f5c
Node.js CI Test / build (12.x) (pull_request) Failing after 6s
Node.js CI Test / build (14.x) (pull_request) Failing after 6s
Node.js CI Test / build (16.x) (pull_request) Successful in 10s
testing js app
2026-05-19 22:10:51 -07:00
..
2026-05-19 22:10:51 -07:00
2026-05-19 22:10:51 -07:00
2026-05-19 22:10:51 -07:00
2026-05-19 22:10:51 -07:00
2026-05-19 22:10:51 -07:00
2026-05-19 22:10:51 -07:00

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'