Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fromKeys: function (data, keys) {
keys = (keys + '').split(',');
var r = {};
for (var i = 0, key = void 0; i < keys.length; i++) {
key = keys[i];
r[key] = Magix.has(data, key) ? data[key] : '';
}
return r;
},
'$[mxc]': function (e) {
fromKeys: function (data, keys) {
keys = (keys + '').split(',');
var r = {};
for (var i = 0, key = void 0; i < keys.length; i++) {
key = keys[i];
r[key] = Magix.has(data, key) ? data[key] : '';
}
return r;
},
'$[mxc]': function (e) {
fromKeys(data, keys) {
keys = (keys + '').split(',');
let r = {};
for (let i = 0, key; i < keys.length; i++) {
key = keys[i];
r[key] = Magix.has(data, key) ? data[key] : '';
}
return r;
},
'$[mxc]'(e) {
getDataByKeys(data, keys) {
keys = (keys + '').split(',');
var r = {};
for (var i = 0, key; i < keys.length; i++) {
key = keys[i];
r[key] = Magix.has(data, key) ? data[key] : '';
}
return r;
},
'syncValue' (e) {
let ListToTree = (list, id, pId) => {
id = id || 'id';
pId = pId || 'pId';
let map = {},
listMap = {},
rootList = [];
for (let i = 0, max = list.length; i < max; i++) {
let one = Magix.mix({}, list[i]);
map[one[id]] = one;
if (listMap[one[id]]) {
one.children = listMap[one[id]];
}
if (Magix.has(one, pId) && one[pId] !== '') {
if (map[one[pId]]) {
let c = map[one[pId]].children || (map[one[pId]].children = []);
c.push(one);
} else {
if (!listMap[one[pId]]) listMap[one[pId]] = [one];
else listMap[one[pId]].push(one);
}
} else {
rootList.push(one);
}
}
return { list: rootList, map };
};
module.exports = Magix.View.extend({