- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs
Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
25 lines
702 B
JavaScript
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
|