diff --git a/src/utility-types.ts b/src/utility-types.ts index 74b604b..d8a84a3 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -13,7 +13,12 @@ import type { } from './create-mutation-keys.types'; import type { AnyMutableOrReadonlyArray } from './types'; -type MergeInsertions = T extends object ? { [K in keyof T]: MergeInsertions } : T; +type Primitive = boolean | string | number | bigint | symbol | undefined | null; + +type MergeInsertions = + T extends Primitive ? T + : T extends object ? { [K in keyof T]: MergeInsertions } + : T; type inferRecordMutationKeys = { [P in Exclude]: Target[P] extends AnyMutableOrReadonlyArray ? Target[P]