diff --git a/lib/util.js b/lib/util.js index 8c5dca6c..a47cd5a1 100644 --- a/lib/util.js +++ b/lib/util.js @@ -203,22 +203,15 @@ * @param pToObj * @param pProps */ - this.copyObj = function(pFromObj, pToObj, pProps) { - var toObj = pToObj || pProps || {}, - forIn = function(obj) { - Util.forIn(obj, function(name) { - toObj[name] = obj[name]; - }); - }; + this.copyObj = function(from, to) { + if (!to) + to = {}; - if (Util.isObject(pFromObj)) { - if (pProps) - forIn(pProps); - - forIn(pFromObj); - } + Util.forIn(from, function(name) { + to[name] = from[name]; + }); - return toObj; + return to; }; this.convertArrToObj = function(pArrKeys, pArrVal) {