diff --git a/src/utility-types.ts b/src/utility-types.ts index 74b604b..21b41c3 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -13,7 +13,16 @@ 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]