Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
putil-merge
Advanced tools
Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone
A 'swiss army knife' solution for merging multiple objects into one. It supports deep merge, cloning objects, copying descriptors and filtering.
$ npm install putil-merge --save
merge([config], target, [source])
Object
]
Boolean
]: If true, it performs deep merge operation.Boolean
]: If true, it clones objects except setting referencesBoolean
]: If true, it copies descriptorsFunction(obj, key, value)
]Object
]Object|Array<Object>
]It supports sequential calling style.
merge.(option).(option)...(target, source)
Etc:
merge(target, source)
Merge source object over target object with deep operation:
merge.deep(target, source)
Merge source object over target object with deep operation and cloning.
merge.deep.clone(target, source)
merge.clone.deep(target, source)
Merge source object descriptors over target object:
merge.descriptor(target, source)
Merge source object descriptors over target object with deep operation:
merge.deep.descriptor(target, [source1, source2])
merge.clone.descriptor(target, source)
merge.deep.clone.descriptor(target, [source1, source2])
merge.deep.clone.descriptor(target, source)
merge.clone.deep.descriptor(target, source)
merge.descriptor.clone.deep(target, source)
merge.descriptor.filter(filterfn)(target, source)
Merge source object over target object:
const a = {prm1: 1, prm2: 2};
const b = {prm1: 11, prm3: [1, 2, 3, 4]};
var merged = merge(a, b);
Clone any object:
const a = {prm1: 1, prm2: { prm3: 3}};
var cloned = merge.clone(a);
var deepCloned = merge.deep.clone(a);
Merge source object over target object with custom filtering:
var a = {id: 1};
var b = {name: 'John', surname: 'Wick'};
var merged = merge.deep.filter(function(o,k,v){
return k === 'name';
})(target, source);
>= 0.10
;FAQs
Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone
The npm package putil-merge receives a total of 43,203 weekly downloads. As such, putil-merge popularity was classified as popular.
We found that putil-merge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.