首页 > TAG信息列表 > cloneTarget

WeakMap缓存深克隆

const isObject = (target) => (typeof target === "object" || typeof target === "function") && target !== null; function deepClone(target, map = new WeakMap()) { if (map.get(target)) { return target; } //