diff --git a/src/errors.test.ts b/src/errors.test.ts index 744503c..c7fd698 100644 --- a/src/errors.test.ts +++ b/src/errors.test.ts @@ -27,18 +27,6 @@ describe('errors', () => { error: new class { public readonly digest = 'DYNAMIC_SERVER_USAGE'; }(), - expected: false, - }, - { - error: new class DynamicServerError { - public readonly digest = 'foo'; - }(), - expected: false, - }, - { - error: new class DynamicServerError { - public readonly digest = 'DYNAMIC_SERVER_USAGE'; - }(), expected: true, }, ])('should return $expected for $error identifying a DynamicServerError', ({error, expected}) => { diff --git a/src/errors.ts b/src/errors.ts index 2c6fffb..f488994 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -5,7 +5,6 @@ export declare class DynamicServerError extends Error { export function isDynamicServerError(error: unknown): error is DynamicServerError { return typeof error === 'object' && error !== null - && error.constructor.name === 'DynamicServerError' && 'digest' in error && error.digest === 'DYNAMIC_SERVER_USAGE'; }