Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

putil-merge

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

putil-merge - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

24

lib/merge.js

@@ -43,14 +43,16 @@ /* putil-merge

const src = source[key];
if (isObject(src)) {
if (!isObject(target[key]))
target[key] = {};
if (cfg.deep)
target[key] = _merge(cfg, target[key], src);
else if (cfg.clone)
if (!cfg.filter || cfg.filter(key, src)) {
if (isObject(src)) {
if (!isObject(target[key]))
target[key] = {};
if (cfg.deep)
target[key] = _merge(cfg, target[key], src);
else if (cfg.clone)
target[key] = JSON.parse(JSON.stringify(src));
else target[key] = src;
} else if (Array.isArray() && cfg.clone)
target[key] = JSON.parse(JSON.stringify(src));
else target[key] = src;
} else if (Array.isArray() && cfg.clone)
target[key] = JSON.parse(JSON.stringify(src));
else
target[key] = src;
else
target[key] = src;
}
}

@@ -57,0 +59,0 @@ }

{
"name": "putil-merge",
"description": "Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone",
"version": "1.0.1",
"version": "1.0.2",
"author": "Panates Ltd.",

@@ -6,0 +6,0 @@ "contributors": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc