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

unpartial

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unpartial - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

6

lib/required.js

@@ -31,3 +31,7 @@ "use strict";

if (Array.isArray(source1)) {
return Array.isArray(source2) ? source2 : source1.concat([source2]);
if (Array.isArray(source2))
return source2;
if (source2 === undefined)
return source1.slice();
return source1.concat([source2]);
}

@@ -34,0 +38,0 @@ return getAllKeys(source1).concat(getAllKeys(source2)).reduce(function (p, k) {

@@ -16,3 +16,7 @@ export function required(source1, source2, source3) {

if (Array.isArray(source1)) {
return Array.isArray(source2) ? source2 : [...source1, source2];
if (Array.isArray(source2))
return source2;
if (source2 === undefined)
return [...source1];
return [...source1, source2];
}

@@ -19,0 +23,0 @@ return getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {

2

package.json
{
"name": "unpartial",
"version": "0.6.2",
"version": "0.6.3",
"description": "Unpartial a partialed object",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/unional/unpartial",

@@ -144,2 +144,6 @@ import { required, requiredDeep } from './required';

})
test('undefined property not added to array', () => {
expect(requiredDeep({ a: [1] }, {})).toEqual({ a: [1] })
})
})

@@ -26,3 +26,5 @@ export function required<

if (Array.isArray(source1)) {
return Array.isArray(source2) ? source2 : [...source1, source2]
if (Array.isArray(source2)) return source2
if (source2 === undefined) return [...source1]
return [...source1, source2]
}

@@ -29,0 +31,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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