diff --git a/src/hooks/alter-items.ts b/src/hooks/alter-items.ts index 77737d5d..f5b46737 100755 --- a/src/hooks/alter-items.ts +++ b/src/hooks/alter-items.ts @@ -1,4 +1,6 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; + import type { Hook, HookContext } from '@feathersjs/feathers'; import { isPromise } from '../common'; import { getItems } from '../utils/get-items'; diff --git a/src/hooks/disallow.ts b/src/hooks/disallow.ts index dd30de9d..9bbbed9d 100755 --- a/src/hooks/disallow.ts +++ b/src/hooks/disallow.ts @@ -1,4 +1,5 @@ -import { MethodNotAllowed } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { MethodNotAllowed } = errors; import type { Hook } from '@feathersjs/feathers'; import type { TransportName } from '../types'; diff --git a/src/hooks/keep-in-array.ts b/src/hooks/keep-in-array.ts index 56a54d27..6e23a880 100755 --- a/src/hooks/keep-in-array.ts +++ b/src/hooks/keep-in-array.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import _get from 'lodash/get'; import _set from 'lodash/set'; import _has from 'lodash/has'; diff --git a/src/hooks/keep-query-in-array.ts b/src/hooks/keep-query-in-array.ts index d4d18420..acf17495 100644 --- a/src/hooks/keep-query-in-array.ts +++ b/src/hooks/keep-query-in-array.ts @@ -1,5 +1,6 @@ import { checkContext } from '../utils/check-context'; -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import _get from 'lodash/get'; import _set from 'lodash/set'; import _has from 'lodash/has'; diff --git a/src/hooks/lower-case.ts b/src/hooks/lower-case.ts index dce5820d..f625d2d5 100755 --- a/src/hooks/lower-case.ts +++ b/src/hooks/lower-case.ts @@ -1,5 +1,6 @@ import _set from 'lodash/set'; -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import { transformItems } from '../common'; import { checkContextIf } from './check-context-if'; diff --git a/src/hooks/populate.ts b/src/hooks/populate.ts index 7170df9e..47daf77c 100755 --- a/src/hooks/populate.ts +++ b/src/hooks/populate.ts @@ -1,6 +1,7 @@ import _get from 'lodash/get'; import _set from 'lodash/set'; -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import { hrtime } from 'process'; diff --git a/src/hooks/prevent-changes.ts b/src/hooks/prevent-changes.ts index d2452a13..e1297c1a 100755 --- a/src/hooks/prevent-changes.ts +++ b/src/hooks/prevent-changes.ts @@ -2,7 +2,8 @@ import _has from 'lodash/has'; import _omit from 'lodash/omit'; import { checkContext } from '../utils/check-context'; -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; /** diff --git a/src/hooks/required.ts b/src/hooks/required.ts index 9d0b2037..e48ec3d2 100755 --- a/src/hooks/required.ts +++ b/src/hooks/required.ts @@ -1,5 +1,6 @@ import _get from 'lodash/get'; -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import _has from 'lodash/has'; import { checkContext } from '../utils/check-context'; diff --git a/src/hooks/run-parallel.ts b/src/hooks/run-parallel.ts index 2de2080c..27b3efb6 100755 --- a/src/hooks/run-parallel.ts +++ b/src/hooks/run-parallel.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; /** diff --git a/src/hooks/set-field.ts b/src/hooks/set-field.ts index e7f66c95..440eba7d 100644 --- a/src/hooks/set-field.ts +++ b/src/hooks/set-field.ts @@ -3,7 +3,8 @@ import _setWith from 'lodash/setWith'; import _clone from 'lodash/clone'; import _debug from 'debug'; import { checkContext } from '../utils/check-context'; -import { Forbidden } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { Forbidden } = errors; import type { Hook } from '@feathersjs/feathers'; import type { SetFieldOptions } from '../types'; diff --git a/src/hooks/set-now.ts b/src/hooks/set-now.ts index 3b09ffe3..65af5744 100755 --- a/src/hooks/set-now.ts +++ b/src/hooks/set-now.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; import { setFields as _setFields } from '../common'; import { getItems } from '../utils/get-items'; diff --git a/src/hooks/set-slug.ts b/src/hooks/set-slug.ts index 6ea45c9d..1730c933 100755 --- a/src/hooks/set-slug.ts +++ b/src/hooks/set-slug.ts @@ -1,5 +1,6 @@ import _set from 'lodash/set'; -import { GeneralError } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { GeneralError } = errors; import type { Hook } from '@feathersjs/feathers'; /** diff --git a/src/hooks/sifter.ts b/src/hooks/sifter.ts index c6e8bed4..f805d492 100755 --- a/src/hooks/sifter.ts +++ b/src/hooks/sifter.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; import type { SyncContextFunction } from '../types'; import { checkContext } from '../utils/check-context'; diff --git a/src/hooks/soft-delete.ts b/src/hooks/soft-delete.ts index 2cc0cec3..1a14fc3d 100755 --- a/src/hooks/soft-delete.ts +++ b/src/hooks/soft-delete.ts @@ -1,4 +1,5 @@ -import { GeneralError } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { GeneralError } = errors; import type { SoftDeleteOptions } from '../types'; import { checkContext } from '../utils/check-context'; diff --git a/src/hooks/stash-before.ts b/src/hooks/stash-before.ts index f9759016..f0286744 100755 --- a/src/hooks/stash-before.ts +++ b/src/hooks/stash-before.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; import { checkContext } from '../utils/check-context'; diff --git a/src/hooks/validate-schema.ts b/src/hooks/validate-schema.ts index b799b864..26ba2f83 100755 --- a/src/hooks/validate-schema.ts +++ b/src/hooks/validate-schema.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; import type { AjvOrNewable, ValidateSchemaOptions } from '../types'; import { getItems } from '../utils/get-items'; diff --git a/src/hooks/validate.ts b/src/hooks/validate.ts index 21c6b044..8c55da72 100755 --- a/src/hooks/validate.ts +++ b/src/hooks/validate.ts @@ -1,4 +1,5 @@ -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; import type { Hook } from '@feathersjs/feathers'; import { isPromise } from '../common'; import type { ValidatorFn } from '../types'; diff --git a/src/utils/is-not.ts b/src/utils/is-not.ts index bd6ee58d..19dc6985 100755 --- a/src/utils/is-not.ts +++ b/src/utils/is-not.ts @@ -1,4 +1,5 @@ -import { MethodNotAllowed } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { MethodNotAllowed } = errors; import { isPromise } from '../common'; import type { PredicateFn } from '../types'; diff --git a/src/utils/is-provider.ts b/src/utils/is-provider.ts index 366632b0..31a19f7f 100755 --- a/src/utils/is-provider.ts +++ b/src/utils/is-provider.ts @@ -1,4 +1,5 @@ -import { MethodNotAllowed } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { MethodNotAllowed } = errors; import type { SyncContextFunction, TransportName } from '../types'; /** diff --git a/test/hooks/validate.test.ts b/test/hooks/validate.test.ts index 21367385..2550819e 100755 --- a/test/hooks/validate.test.ts +++ b/test/hooks/validate.test.ts @@ -1,6 +1,7 @@ import { assert } from 'chai'; import { validate } from '../../src'; -import { BadRequest } from '@feathersjs/errors'; +import errors from '@feathersjs/errors'; +const { BadRequest } = errors; let fcnSync: any; let fcnPromise: any;