Skip to content

Commit 1a5c437

Browse files
Copilotymc9
andcommitted
Simplify HasRelations using RelationFields extends never form
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
1 parent 46ea0e2 commit 1a5c437

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/orm/src/client/crud-types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,9 +2392,10 @@ type HasToManyRelations<Schema extends SchemaDef, Model extends GetModels<Schema
23922392
? false
23932393
: true;
23942394

2395-
type HasRelations<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof {
2396-
[Key in RelationFields<Schema, Model>]: true;
2397-
} extends never
2395+
type HasRelations<Schema extends SchemaDef, Model extends GetModels<Schema>> = RelationFields<
2396+
Schema,
2397+
Model
2398+
> extends never
23982399
? false
23992400
: true;
24002401

0 commit comments

Comments
 (0)