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

plain-object-merge

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plain-object-merge - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.github/FUNDING.yml

4

dist/index.js

@@ -17,3 +17,5 @@ "use strict";

if (isPrimitive(value)) {
target[key] = value;
if (value !== undefined || !(key in target)) {
target[key] = value;
}
}

@@ -20,0 +22,0 @@ else if (!target[key] || Array.isArray(value)) {

{
"name": "plain-object-merge",
"description": "Extremely fast function optimized for deep merging json-serializable plain objects.",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

@@ -31,4 +31,8 @@

target[key] = value;
if ( value !== undefined || !(key in target) ) {
target[key] = value;
}
} else if ( !target[key] || Array.isArray ( value ) ) {

@@ -35,0 +39,0 @@

@@ -21,3 +21,3 @@

null: null,
undefined: undefined,
undefined: 123,
arr: ['1', '2', '3'],

@@ -24,0 +24,0 @@ deep: {

@@ -12,3 +12,3 @@

it ( 'works', t => {
it ( 'can merge complext objects', t => {

@@ -19,2 +19,12 @@ t.deepEqual ( merge ( Fixtures.parts ), Fixtures.result );

it ( 'supports undefined', t => {
t.deepEqual ( merge ([ {}, { foo: undefined } ]), { foo: undefined } );
t.deepEqual ( merge ([ { foo: 0 }, { foo: undefined } ]), { foo: 0 } );
t.deepEqual ( merge ([ { foo: {} }, { foo: undefined } ]), { foo: {} } );
});
});
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