Files
lan-manager/web/node_modules/@antv/layout/es/util/object.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

25 lines
702 B
JavaScript

export const isObject = (val) => val !== null && typeof val === 'object';
export const clone = (target) => {
if (target === null) {
return target;
}
if (target instanceof Date) {
return new Date(target.getTime());
}
if (target instanceof Array) {
const cp = [];
target.forEach((v) => {
cp.push(v);
});
return cp.map((n) => clone(n));
}
if (typeof target === 'object' && Object.keys(target).length) {
const cp = Object.assign({}, target);
Object.keys(cp).forEach((k) => {
cp[k] = clone(cp[k]);
});
return cp;
}
return target;
};
//# sourceMappingURL=object.js.map