From e0a6a235b705f3e67714042cb33b581ff87d9330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99gielewski?= Date: Fri, 29 Mar 2024 17:07:03 +0100 Subject: [PATCH] fix: fix Resource#isAdapterFor so that it doesn't throw an error --- src/Resource.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Resource.ts b/src/Resource.ts index e6f2bec..f770360 100644 --- a/src/Resource.ts +++ b/src/Resource.ts @@ -13,13 +13,7 @@ import { DatabaseDialect } from './dialects/index.js'; export class Resource extends BaseResource { static override isAdapterFor(resource: any): boolean { - const r = resource instanceof ResourceMetadata; - - if (!r) { - throw new Error('Resource must contain valid metadata.'); - } - - return r; + return resource instanceof ResourceMetadata; } private knex: Knex;