mapObject func

This commit is contained in:
Mirco Wittrien 2019-08-21 15:41:55 +02:00
parent da4f7bc68b
commit 76085c8095
2 changed files with 8 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -769,6 +769,13 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
if (BDFDB.isObject(obj)) obj[Object.keys(obj).length] = value;
};
BDFDB.mapObject = function (obj, keyname) {
if (BDFDB.isObject(obj) && typeof keyname == "string") {
var newobj;
for (let key in obj) newobj[key] = obj[key][keyname];
}
};
BDFDB.deepAssign = function (obj, ...objs) {
if (!objs.length) return obj;
var nextobj = objs.shift();