mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-29 13:59:26 +01:00
fix type of deepMerge
This commit is contained in:
parent
ca94959fff
commit
194bc20af1
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ function isPureObject(value: unknown): value is Record<string | number | symbol,
|
|||
* valueにないキーをdefからもらう(再帰的)\
|
||||
* nullはそのまま、undefinedはdefの値
|
||||
**/
|
||||
export function deepMerge<X extends Record<string | number | symbol, unknown>>(value: DeepPartial<X>, def: X): X {
|
||||
export function deepMerge<X extends object>(value: DeepPartial<X>, def: X): X {
|
||||
if (isPureObject(value) && isPureObject(def)) {
|
||||
const result = deepClone(value as Cloneable) as X;
|
||||
for (const [k, v] of Object.entries(def) as [keyof X, X[keyof X]][]) {
|
||||
|
|
Loading…
Reference in a new issue