Skip to content

Commit 0c5b2c0

Browse files
committed
fix(esm): import errors from @feathersjs/errors
1 parent 0098dd5 commit 0c5b2c0

20 files changed

+41
-20
lines changed

src/hooks/alter-items.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { BadRequest } from '@feathersjs/errors';
1+
import errors from '@feathersjs/errors';
2+
const { BadRequest } = errors;
3+
24
import type { Hook, HookContext } from '@feathersjs/feathers';
35
import { isPromise } from '../common';
46
import { getItems } from '../utils/get-items';

src/hooks/disallow.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { MethodNotAllowed } from '@feathersjs/errors';
1+
import errors from '@feathersjs/errors';
2+
const { MethodNotAllowed } = errors;
23
import type { Hook } from '@feathersjs/feathers';
34
import type { TransportName } from '../types';
45

src/hooks/keep-in-array.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { BadRequest } from '@feathersjs/errors';
1+
import errors from '@feathersjs/errors';
2+
const { BadRequest } = errors;
23
import _get from 'lodash/get';
34
import _set from 'lodash/set';
45
import _has from 'lodash/has';

src/hooks/keep-query-in-array.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { checkContext } from '../utils/check-context';
2-
import { BadRequest } from '@feathersjs/errors';
2+
import errors from '@feathersjs/errors';
3+
const { BadRequest } = errors;
34
import _get from 'lodash/get';
45
import _set from 'lodash/set';
56
import _has from 'lodash/has';

src/hooks/lower-case.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import _set from 'lodash/set';
2-
import { BadRequest } from '@feathersjs/errors';
2+
import errors from '@feathersjs/errors';
3+
const { BadRequest } = errors;
34

45
import { transformItems } from '../common';
56
import { checkContextIf } from './check-context-if';

src/hooks/populate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import _get from 'lodash/get';
22
import _set from 'lodash/set';
3-
import { BadRequest } from '@feathersjs/errors';
3+
import errors from '@feathersjs/errors';
4+
const { BadRequest } = errors;
45

56
import { hrtime } from 'process';
67

src/hooks/prevent-changes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import _has from 'lodash/has';
22
import _omit from 'lodash/omit';
33

44
import { checkContext } from '../utils/check-context';
5-
import { BadRequest } from '@feathersjs/errors';
5+
import errors from '@feathersjs/errors';
6+
const { BadRequest } = errors;
67
import type { Hook } from '@feathersjs/feathers';
78

89
/**

src/hooks/required.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import _get from 'lodash/get';
2-
import { BadRequest } from '@feathersjs/errors';
2+
import errors from '@feathersjs/errors';
3+
const { BadRequest } = errors;
34
import _has from 'lodash/has';
45

56
import { checkContext } from '../utils/check-context';

src/hooks/run-parallel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { BadRequest } from '@feathersjs/errors';
1+
import errors from '@feathersjs/errors';
2+
const { BadRequest } = errors;
23
import type { Hook } from '@feathersjs/feathers';
34

45
/**

src/hooks/set-field.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import _setWith from 'lodash/setWith';
33
import _clone from 'lodash/clone';
44
import _debug from 'debug';
55
import { checkContext } from '../utils/check-context';
6-
import { Forbidden } from '@feathersjs/errors';
6+
import errors from '@feathersjs/errors';
7+
const { Forbidden } = errors;
78
import type { Hook } from '@feathersjs/feathers';
89
import type { SetFieldOptions } from '../types';
910

0 commit comments

Comments
 (0)