Skip to content

Commit

Permalink
fix: fix Resource#isAdapterFor so that it doesn't throw an error
Browse files Browse the repository at this point in the history
  • Loading branch information
dziraf authored Mar 29, 2024
1 parent 2ed9cc4 commit e0a6a23
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e0a6a23

Please sign in to comment.