![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
setprototypeof
Advanced tools
Package description
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.
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"}}
The object-assign package is used to copy the values of all enumerable own properties from one or more source objects to a target object. It is similar to setprototypeof in that it is used for manipulating objects, but it does not change the prototype chain.
Lodash's assign function is similar to object-assign and is used to assign own enumerable properties of source objects to the destination object. Like object-assign, it does not deal with the prototype chain but rather with copying properties.
The util package is a collection of utilities originally for the Node.js standard library. It includes util.inherits, which is a method that allows you to set the prototype of a constructor to an object, creating a prototype chain similar to what setprototypeof does, but specifically for constructor functions.
Readme
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.
$ 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 = require('setprototypeof');
FAQs
A small polyfill for Object.setprototypeof
The npm package setprototypeof receives a total of 43,047,924 weekly downloads. As such, setprototypeof popularity was classified as popular.
We found that setprototypeof demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.