@hapi/hoek
Advanced tools
Comparing version 7.2.0 to 7.2.1
'use strict'; | ||
// Load modules | ||
const Types = require('./types'); | ||
// Declare internals | ||
const internals = { | ||
@@ -17,3 +13,3 @@ mismatched: null | ||
options = { prototype: true, ...options }; | ||
options = Object.assign({ prototype: true }, options); | ||
@@ -20,0 +16,0 @@ return !!internals.isDeepEqual(obj, ref, options, []); |
'use strict'; | ||
// Declare internals | ||
const internals = {}; | ||
@@ -6,0 +4,0 @@ |
'use strict'; | ||
// Load modules | ||
const Assert = require('assert'); | ||
@@ -14,4 +12,2 @@ const Crypto = require('crypto'); | ||
// Declare internals | ||
const internals = { | ||
@@ -158,3 +154,4 @@ needsProtoHack: new Set([Types.set, Types.map, Types.weakSet, Types.weakMap]) | ||
const keys = options.shallow; | ||
options = { ...options, shallow: false }; | ||
options = Object.assign({}, options); | ||
options.shallow = false; | ||
@@ -221,3 +218,3 @@ const storage = internals.store(source, keys); // Move shallow copy items to storage | ||
options = { nullOverride: true, mergeArrays: true, ...options }; | ||
options = Object.assign({ nullOverride: true, mergeArrays: true }, options); | ||
@@ -281,7 +278,7 @@ if (Array.isArray(source)) { | ||
exports.applyToDefaults = function (defaults, source, options) { | ||
exports.applyToDefaults = function (defaults, source, options = {}) { | ||
exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); | ||
exports.assert(!source || source === true || typeof source === 'object', 'Invalid source value: must be true, falsy or an object'); | ||
exports.assert(options === undefined || options && typeof options === 'object', 'Invalid options: must be an object'); | ||
exports.assert(typeof options === 'object', 'Invalid options: must be an object'); | ||
@@ -292,5 +289,3 @@ if (!source) { // If no source, return null | ||
if (options && | ||
options.shallow) { | ||
if (options.shallow) { | ||
return internals.applyToDefaultsWithShallow(defaults, source, options); | ||
@@ -305,3 +300,3 @@ } | ||
const nullOverride = options && options.nullOverride !== undefined ? options.nullOverride : false; | ||
const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false; | ||
return exports.merge(copy, source, { nullOverride, mergeArrays: false }); | ||
@@ -316,3 +311,4 @@ }; | ||
options = { ...options, shallow: false }; | ||
options = Object.assign({}, options); | ||
options.shallow = false; | ||
@@ -319,0 +315,0 @@ const copy = exports.clone(defaults, { shallow: keys }); |
{ | ||
"name": "@hapi/hoek", | ||
"description": "General purpose node utilities", | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"repository": "git://github.com/hapijs/hoek", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43786
1167