Skip to content

Commit c1ae3a4

Browse files
committed
Adjust resource relations runtime check
With the `Props` list no longer being a requirement, the only runtime requirement we have is the value having a `prototype`.
1 parent b22e428 commit c1ae3a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/common/resource.dto.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ export class EnhancedResource<T extends ResourceShape<any>> {
252252
const type: ResourceShape<any> | undefined = list
253253
? rawType[0]!
254254
: rawType;
255-
const resource: EnhancedResource<any> | undefined =
256-
type && isResourceClass(type) ? EnhancedResource.of(type) : undefined;
255+
const resource: EnhancedResource<any> | undefined = type?.prototype
256+
? EnhancedResource.of(type)
257+
: undefined;
257258
const rel: EnhancedRelation<T> = { name, list, type, resource };
258259
return [name, rel];
259260
}),

0 commit comments

Comments
 (0)