Socket
Socket
Sign inDemoInstall

setprototypeof

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    setprototypeof

A small polyfill for Object.setprototypeof


Version published
Weekly downloads
42M
decreased by-8.48%
Maintainers
1
Install size
2.75 kB
Created
Weekly downloads
 

Package description

What is setprototypeof?

The setprototypeof package is a simple module that allows you to set the prototype of an object, which can be useful for creating a chain of prototypes (i.e., inheritance) or for changing an object's prototype on-the-fly. It is a polyfill for the official ECMAScript 2015 (ES6) Object.setPrototypeOf method.

What are setprototypeof's main functionalities?

Setting the prototype of an object

This feature allows you to set the prototype of an object to another object. After setting the prototype, the object will have access to the properties and methods of the new prototype.

{"object": {"prop": "value"}, "prototype": {"newProp": "newValue"}}

Other packages similar to setprototypeof

Readme

Source

Polyfill for Object.setPrototypeOf

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

Keywords

FAQs

Last updated on 20 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc