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

Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53K
decreased by-11.58%
Maintainers
1
Weekly downloads
 
Created
Source

putil-merge

NPM Version NPM Downloads Build Status Test Coverage Dependencies DevDependencies

Lightweight solution for merging multiple objects into one. Also it supports deep merge

Installation

  • npm install putil-merge --save

Usage

merge(target, ...source)

Combines source objects with the target object without deep operation. Also it copies references instead of cloning.

merge.deep(target, ...source)

Combines source objects with the target object with deep operation. Also it copies references instead of cloning.

merge.clone(target, ...source)

Combines source objects with the target object without deep operation. Also it clones values.

merge.deepClone(target, ...source)

Combines source objects with the target object with deep operation. Also it clones values.

const a = {l1a: 1, l1b: '2', l1d: {l2a: 1}};
const b = {l1b: 'b', l1c: 3, l1d: {l2b: {l3a: '2'}}, l1e: [1, 2, 3, 4]};
let o = merge(a, b);

Node Compatibility

  • node >= 6.x;

License

MIT

Keywords

FAQs

Package last updated on 17 Jul 2017

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

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