@henry781/deep-merge
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -6,2 +6,3 @@ export interface MergeOptions { | ||
allowUndefined?: boolean; | ||
securityNbDeepMax?: number; | ||
logger?: { | ||
@@ -8,0 +9,0 @@ log: (...args: any[]) => void; |
@@ -12,2 +12,3 @@ "use strict"; | ||
options.logger = options.logger ? options.logger : console; | ||
options.securityNbDeepMax = options.securityNbDeepMax ? options.securityNbDeepMax : 10000; | ||
return this.processMerge(obj1, obj2, options); | ||
@@ -43,3 +44,2 @@ }; | ||
var debug = false; | ||
var securityNbDeepMax = 1000; | ||
if (!securityMergeMyID) { | ||
@@ -56,3 +56,3 @@ this.safetyMergeNbID++; | ||
this.safetyNbDeepCurrent[this.safetyMergeNbID]++; | ||
if (this.safetyNbDeepCurrent[this.safetyMergeNbID] >= securityNbDeepMax) { | ||
if (this.safetyNbDeepCurrent[this.safetyMergeNbID] >= options.securityNbDeepMax) { | ||
options.logger.error('Merge [' + securityMergeMyID + ']' + this.mergeDebugIteration(iterationNumber) + | ||
@@ -59,0 +59,0 @@ 'stopping merge because of too much whiles (' + this.safetyNbDeepCurrent[this.safetyMergeNbID] + ')'); |
{ | ||
"name": "@henry781/deep-merge", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/api.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17294
227