Have ideas to improve npm?Join in the discussion! »

    setprototypeof
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.0 • Public • Published

    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'

    Install

    npm i setprototypeof

    DownloadsWeekly Downloads

    31,233,996

    Version

    1.2.0

    License

    ISC

    Unpacked Size

    4.03 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar