console
function deepClone(obj, regex, hash = new WeakMap()) {
if (Object(obj) !== obj) return typeof obj === 'number' ? 0 : '';
if (obj instanceof Set) return new Set(obj);
if (hash.has(obj)) return hash.get(obj);
const result = obj instanceof Date ? new Date(obj)
: obj instanceof RegExp ? new RegExp(obj.source, obj.flags)
: obj.constructor ? new obj.constructor()
: Object.create(null);
hash.set(obj, result);
if (obj instanceof Map)
Array.from(obj, ([key, val]) => result.set(key, deepClone(val, hash)) );
return Object.assign(result, ...Object.keys(obj).filter(key => !regex.test(key)).map (
key => ({ [key]: deepClone(obj[key], regex, hash) }) ));
}
var p = {
data: 1,
children: [{
data: 2,
parent: null
}]
};
var q = deepClone(p,/^\w+(default|list)$/i);
console.log(JSON.stringify(q));
<div>
<div style='font-weight:bold'>表单数据异常:</div>
<ol style='margin-top:0px'>
<li>请检查申请人、单位、归属部门是否填写!</li>
<li>请确认单位对应扩展属性:“对应法人公司”是否配置!</li>
<li>请确认归属部门对应扩展属性:“审批层级”是否配置!</li>
<li>请检查借款金额是否填写!</li>
</ol>
</div>