New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

create-assign

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-assign

A combination of calling Object.create() then Object.assign().

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

create-assign

A combination of calling Object.create() then Object.assign().

Install

npm install create-assign

Usage & Api


var create_assign = require("create-assign");

//create_assign(proto, properties /*, properties2, ...*/)

var a = {
    f1: function () { return 1; },
    f2: function () { return 2; },
};
var b = {
    f3: function () { return 3; },
    f4: function () { return 4; },
};
var c = create_assign(a, b, {
    f2: function () { return 22; },
    f3: function () { return 33; },
});

assert(
	c.f1() === 1 && c.f2() === 22 && c.f3() === 33 && c.f4() === 4 &&
	('f1' in c) && !c.hasOwnProperty('f1') && c.hasOwnProperty('f4') &&
	a.isPrototypeOf(c) && !b.isPrototypeOf(c)
);

Keywords

object

FAQs

Package last updated on 26 Mar 2022

Did you know?

Socket

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