mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-10 01:57:51 +08:00
add talent life
This commit is contained in:
12
src/functions/util.js
Normal file
12
src/functions/util.js
Normal file
@@ -0,0 +1,12 @@
|
||||
function clone(value) {
|
||||
switch(typeof value) {
|
||||
case 'object':
|
||||
if(Array.isArray(value)) return value.map(v=>clone(v));
|
||||
const newObj = {};
|
||||
for(const key in value) newObj[key] = clone(value[key]);
|
||||
return newObj;
|
||||
default: return value;
|
||||
}
|
||||
}
|
||||
|
||||
export { clone };
|
||||
Reference in New Issue
Block a user