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

smart-assign

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smart-assign

a smarter version of Object.assign

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

SmartAssign

a smarter version of Object.assign. deep assign when Object.assign is defined, otherwise, it will deep copy every property iteratively.

install

npm install --save smart-assign

usage example

'use strict';
import smartAssign from '../lib/index';  

let data = 'data';  

smartAssign(  
    {},  
    {  
        a: {  
            a1: 'a1',  
            a2: () => {  
                return 'a2';  
            },  
        },  
        b: {  
            b1: function () {  
                console.log('b1 enter.')  
            },  
            b2: function () {  
                return data;  
            },  
        },  
    }  
); 

tips

Objects without prototype can not be copied, can not be assigned, thus it will never change as the first parameter, and never be copied as other parameters

FAQs

Package last updated on 26 Oct 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