@travetto/base
Advanced tools
Comparing version 0.0.71 to 0.0.72
@@ -19,3 +19,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.71" | ||
"version": "0.0.72" | ||
} |
@@ -41,3 +41,9 @@ export function isPrimitive(el: any): el is (string | boolean | number | RegExp) { | ||
if (isEmptyA || isEmptyB) { // If no `a`, `b` always wins | ||
ret = b === null ? b : shallowClone(b || a); | ||
if (b === null || !isEmptyB) { | ||
ret = isEmptyB ? b : shallowClone(b); | ||
} else if (!isEmptyA) { | ||
ret = shallowClone(a); | ||
} else { | ||
ret = undefined; | ||
} | ||
} else { | ||
@@ -44,0 +50,0 @@ if (isArrA !== isArrB || isSimpA !== isSimpB) { |
@@ -43,2 +43,3 @@ import { deepAssign, isPrimitive, isFunction } from '../src/util'; | ||
assert(deepAssign({ line: 20, file: 30 }, { description: undefined }).description === undefined); | ||
} | ||
@@ -63,2 +64,2 @@ | ||
testStrict(); | ||
testCoerce(); | ||
testCoerce(); |
28625
853