OpenStreetMap-Service/node_modules/setprototypeof
zhangxunhui 54690c2f41 openstreetmap service 2026-03-26 22:27:42 +08:00
..
test openstreetmap service 2026-03-26 22:27:42 +08:00
LICENSE openstreetmap service 2026-03-26 22:27:42 +08:00
README.md openstreetmap service 2026-03-26 22:27:42 +08:00
index.d.ts openstreetmap service 2026-03-26 22:27:42 +08:00
index.js openstreetmap service 2026-03-26 22:27:42 +08:00
package.json openstreetmap service 2026-03-26 22:27:42 +08:00

README.md

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'