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.1 to 0.6.2

2

lib/required.js

@@ -29,3 +29,3 @@ "use strict";

if (typeof source1 !== 'object' || source1 === null)
return source2 || source1;
return source2 !== undefined ? source2 : source1;
if (Array.isArray(source1)) {

@@ -32,0 +32,0 @@ return Array.isArray(source2) ? source2 : source1.concat([source2]);

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

if (typeof source1 !== 'object' || source1 === null)
return source2 || source1;
return source2 !== undefined ? source2 : source1;
if (Array.isArray(source1)) {

@@ -17,0 +17,0 @@ return Array.isArray(source2) ? source2 : [...source1, source2];

{
"name": "unpartial",
"version": "0.6.1",
"version": "0.6.2",
"description": "Unpartial a partialed object",

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

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

})
test('empty string overrides', () => {
expect(requiredDeep({ a: { b: 'b' } }, { a: { b: '' } })).toEqual({ a: { b: '' } })
})
})

@@ -24,3 +24,3 @@ export function required<

function deepmerge(source1: any, source2: any): any {
if (typeof source1 !== 'object' || source1 === null) return source2 || source1
if (typeof source1 !== 'object' || source1 === null) return source2 !== undefined ? source2 : source1
if (Array.isArray(source1)) {

@@ -27,0 +27,0 @@ return Array.isArray(source2) ? source2 : [...source1, source2]

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