Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(esm): import errors from @feathersjs/errors #675

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/hooks/alter-items.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/disallow.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/hooks/keep-in-array.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/keep-query-in-array.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/lower-case.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/populate.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/hooks/prevent-changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/required.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/run-parallel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BadRequest } from '@feathersjs/errors';
import errors from '@feathersjs/errors';
const { BadRequest } = errors;
import type { Hook } from '@feathersjs/feathers';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/set-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/hooks/set-now.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/set-slug.ts
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/sifter.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/soft-delete.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/hooks/stash-before.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/hooks/validate-schema.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/validate.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/utils/is-not.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/utils/is-provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MethodNotAllowed } from '@feathersjs/errors';
import errors from '@feathersjs/errors';
const { MethodNotAllowed } = errors;
import type { SyncContextFunction, TransportName } from '../types';

/**
Expand Down
3 changes: 2 additions & 1 deletion test/hooks/validate.test.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down