diff options
author | Raphael <mail@raphaelkabo.com> | 2025-04-29 22:02:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-29 22:02:12 +0100 |
commit | 69f75005303d634b9208c23068655385734f4d3a (patch) | |
tree | 9f14b63c602a2968cf2e5e0ab822f34fd520058a /src/util/object.ts | |
parent | b04e6394c5c5d882800f5215feae89d76a18af23 (diff) | |
parent | cc68811851f02f413bbd5bcf316d1697a0e83bae (diff) |
Merge pull request #202 from halkeye/fix-nodemailer
Fix ReferenceError: nodemailerTransporter is not defined
Diffstat (limited to 'src/util/object.ts')
-rw-r--r-- | src/util/object.ts | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/util/object.ts b/src/util/object.ts deleted file mode 100644 index 1ecc89b..0000000 --- a/src/util/object.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Simple object check. - */ -export function isObject(item: any) { - return item && typeof item === "object" && !Array.isArray(item); -} - -/** - * Deep merge two objects. - */ -export function deepMerge<T>( - target: Record<any, any>, - ...sources: Record<any, any>[] -): T { - if (!sources.length) return target; - const source = sources.shift(); - - if (isObject(target) && isObject(source)) { - for (const key in source) { - if (isObject(source[key])) { - if (!target[key]) Object.assign(target, { [key]: {} }); - deepMerge(target[key], source[key]); - } else { - Object.assign(target, { [key]: source[key] }); - } - } - } - - return deepMerge(target, ...sources) as T; -} |