From 568aa702cae8e4fcd47e9f9ee1a6e458b99cc8dc Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Wed, 3 Dec 2014 18:14:50 +0100 Subject: [PATCH] removed double code --- lib/util.js | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/lib/util.js b/lib/util.js index 7294f406..1cb61d2a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1099,7 +1099,7 @@ exports.mergeOptions = function (mergeTarget, options, option) { } else { mergeTarget[option].enabled = true; - for (prop in options[option]) { + for (var prop in options[option]) { if (options[option].hasOwnProperty(prop)) { mergeTarget[option][prop] = options[option][prop]; } @@ -1109,34 +1109,6 @@ exports.mergeOptions = function (mergeTarget, options, option) { } -/** - * this is used to set the options of subobjects in the options object. A requirement of these subobjects - * is that they have an 'enabled' element which is optional for the user but mandatory for the program. - * - * @param [object] mergeTarget | this is either this.options or the options used for the groups. - * @param [object] options | options - * @param [String] option | this is the option key in the options argument - * @private - */ -exports.mergeOptions = function (mergeTarget, options, option) { - if (options[option] !== undefined) { - if (typeof options[option] == 'boolean') { - mergeTarget[option].enabled = options[option]; - } - else { - mergeTarget[option].enabled = true; - for (prop in options[option]) { - if (options[option].hasOwnProperty(prop)) { - mergeTarget[option][prop] = options[option][prop]; - } - } - } - } -} - - - - /** * This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses * this function will then iterate in both directions over this sorted list to find all visible items.