From eb4183e5441ea8b36bbb8f24ffa38ba850eb389c Mon Sep 17 00:00:00 2001 From: Rebecca Stevens Date: Wed, 6 Apr 2022 15:30:45 +1200 Subject: [PATCH] fix: use explict return types for function that return a HKT this results in simpler dist types fix #94 --- src/deepmerge.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/deepmerge.ts b/src/deepmerge.ts index 82c580e3..efeb5309 100644 --- a/src/deepmerge.ts +++ b/src/deepmerge.ts @@ -407,7 +407,11 @@ function defaultMergeRecords< MF extends DeepMergeMergeFunctionsURIs, M, MM extends DeepMergeBuiltInMetaData ->(values: Ts, utils: U, meta: M | undefined) { +>( + values: Ts, + utils: U, + meta: M | undefined +): DeepMergeRecordsDefaultHKT { const result: Record = {}; /* eslint-disable functional/no-loop-statement, functional/no-conditional-statement -- using a loop here is more performant. */ @@ -464,7 +468,7 @@ function defaultMergeArrays< Ts extends ReadonlyArray>, MF extends DeepMergeMergeFunctionsURIs, M ->(values: Ts) { +>(values: Ts): DeepMergeArraysDefaultHKT { return values.flat() as DeepMergeArraysDefaultHKT; } @@ -475,7 +479,7 @@ function defaultMergeArrays< */ function defaultMergeSets< Ts extends ReadonlyArray>> ->(values: Ts) { +>(values: Ts): DeepMergeSetsDefaultHKT { return new Set(getIterableOfIterables(values)) as DeepMergeSetsDefaultHKT; } @@ -486,7 +490,7 @@ function defaultMergeSets< */ function defaultMergeMaps< Ts extends ReadonlyArray>> ->(values: Ts) { +>(values: Ts): DeepMergeMapsDefaultHKT { return new Map(getIterableOfIterables(values)) as DeepMergeMapsDefaultHKT; }