Skip to content

Commit

Permalink
do not allow fields with the same name in Type and AdditionalFields
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Mar 23, 2024
1 parent 43153e9 commit 99e8845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helper/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export interface DefineTypeFactoryInterfaceRequired<
defaultTransientFields: NewTransientFields,
): DefineTypeFactoryInterface<Type, Merge<TransientFields, NewTransientFields>>;
withAdditionalFields<AdditionalFields extends Record<string, unknown>>(): DefineTypeFactoryInterface<
Merge<Type, AdditionalFields>,
Type & AdditionalFields,
TransientFields
>;
}
Expand Down Expand Up @@ -185,7 +185,7 @@ class DefineTypeFactory<
return new DefineTypeFactory({ ...this._defaultTransientFields, ...defaultTransientFields }) as any;
}
withAdditionalFields<AdditionalFields extends Record<string, unknown>>(): DefineTypeFactoryInterface<
Merge<Type, AdditionalFields>,
Type & AdditionalFields,
TransientFields
> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit 99e8845

Please sign in to comment.