refactor(util) copyObj

This commit is contained in:
coderaiser 2014-02-07 10:49:40 -05:00
parent 86cbe86f60
commit 749c861f86

View file

@ -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) {