mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-04-30 18:59:40 +00:00
Updated bot source
This commit is contained in:
parent
3a6a2763f8
commit
0dd6702e33
19 changed files with 247 additions and 20 deletions
16
source/util/object/merge.ts
Normal file
16
source/util/object/merge.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
export function recursive_merge(
|
||||
defaulted: any,
|
||||
target: any
|
||||
) {
|
||||
let output = defaulted;
|
||||
|
||||
Object.keys(target).forEach((target_key) => {
|
||||
if (typeof target_key != "object") {
|
||||
output[target_key] = target[target_key];
|
||||
} else {
|
||||
output[target_key] = recursive_merge(defaulted[target_key], target[target_key]);
|
||||
}
|
||||
});
|
||||
|
||||
return output;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue