feathers-utils 1.9.4 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import type { HookRunPerItemOptions, ReturnAsyncHook, Promisable } from "../types";
2
2
  import type { HookContext } from "@feathersjs/feathers";
3
- export declare const runPerItem: (actionPerItem: (item: any, context: HookContext) => Promisable<any>, options: HookRunPerItemOptions) => ReturnAsyncHook;
3
+ export declare const runPerItem: (actionPerItem: (item: any, context: HookContext) => Promisable<any>, _options?: HookRunPerItemOptions | undefined) => ReturnAsyncHook;
@@ -8,8 +8,8 @@ const makeOptions = (options) => {
8
8
  };
9
9
  export const runPerItem = (
10
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
- actionPerItem, options) => {
12
- options = makeOptions(options);
11
+ actionPerItem, _options) => {
12
+ const options = makeOptions(_options);
13
13
  return async (context) => {
14
14
  if (shouldSkip("runForItems", context)) {
15
15
  return context;
@@ -4,7 +4,7 @@ import { runPerItem } from "./hooks/runPerItem";
4
4
  export declare const hooks: {
5
5
  checkMulti: typeof checkMulti;
6
6
  setData: typeof setData;
7
- runPerItem: (actionPerItem: (item: any, context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => any, options: import("./types").HookRunPerItemOptions) => import("./types").ReturnAsyncHook;
7
+ runPerItem: (actionPerItem: (item: any, context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => any, _options?: import("./types").HookRunPerItemOptions | undefined) => import("./types").ReturnAsyncHook;
8
8
  };
9
9
  export { checkMulti };
10
10
  export { setData };
@@ -1,3 +1,3 @@
1
1
  import type { HookRunPerItemOptions, ReturnAsyncHook, Promisable } from "../types";
2
2
  import type { HookContext } from "@feathersjs/feathers";
3
- export declare const runPerItem: (actionPerItem: (item: any, context: HookContext) => Promisable<any>, options: HookRunPerItemOptions) => ReturnAsyncHook;
3
+ export declare const runPerItem: (actionPerItem: (item: any, context: HookContext) => Promisable<any>, _options?: HookRunPerItemOptions | undefined) => ReturnAsyncHook;
@@ -20,8 +20,8 @@ const makeOptions = (options) => {
20
20
  };
21
21
  const runPerItem = (
22
22
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
- actionPerItem, options) => {
24
- options = makeOptions(options);
23
+ actionPerItem, _options) => {
24
+ const options = makeOptions(_options);
25
25
  return (context) => __awaiter(void 0, void 0, void 0, function* () {
26
26
  if ((0, shouldSkip_1.shouldSkip)("runForItems", context)) {
27
27
  return context;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { runPerItem } from "./hooks/runPerItem";
4
4
  export declare const hooks: {
5
5
  checkMulti: typeof checkMulti;
6
6
  setData: typeof setData;
7
- runPerItem: (actionPerItem: (item: any, context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => any, options: import("./types").HookRunPerItemOptions) => import("./types").ReturnAsyncHook;
7
+ runPerItem: (actionPerItem: (item: any, context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => any, _options?: import("./types").HookRunPerItemOptions | undefined) => import("./types").ReturnAsyncHook;
8
8
  };
9
9
  export { checkMulti };
10
10
  export { setData };
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feathers-utils",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Some utils for projects using '@feathersjs/feathers'",
5
5
  "author": "fratzinger",
6
6
  "repository": {
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
49
- "@types/lodash": "^4.14.178",
49
+ "@types/lodash": "^4.14.179",
50
50
  "@types/mocha": "^9.1.0",
51
- "@types/node": "^17.0.19",
52
- "@typescript-eslint/eslint-plugin": "^5.12.0",
53
- "@typescript-eslint/parser": "^5.12.0",
51
+ "@types/node": "^17.0.21",
52
+ "@typescript-eslint/eslint-plugin": "^5.13.0",
53
+ "@typescript-eslint/parser": "^5.13.0",
54
54
  "cross-env": "^7.0.3",
55
- "eslint": "^8.9.0",
55
+ "eslint": "^8.10.0",
56
56
  "eslint-import-resolver-typescript": "^2.5.0",
57
57
  "eslint-plugin-import": "^2.25.4",
58
58
  "eslint-plugin-security": "^1.4.0",
@@ -62,6 +62,6 @@
62
62
  "nyc": "^15.1.0",
63
63
  "shx": "^0.3.4",
64
64
  "ts-node": "^10.5.0",
65
- "typescript": "^4.5.5"
65
+ "typescript": "^4.6.2"
66
66
  }
67
67
  }
@@ -5,7 +5,7 @@ import type { HookContext } from "@feathersjs/feathers";
5
5
  import { getItemsIsArray } from "../utils/getItemsIsArray";
6
6
 
7
7
  const makeOptions = (
8
- options: HookRunPerItemOptions
8
+ options?: HookRunPerItemOptions
9
9
  ): Required<HookRunPerItemOptions> => {
10
10
  options = options || {};
11
11
  return Object.assign({
@@ -16,9 +16,9 @@ const makeOptions = (
16
16
  export const runPerItem = (
17
17
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
18
  actionPerItem: (item: any, context: HookContext) => Promisable<any>,
19
- options: HookRunPerItemOptions
19
+ _options?: HookRunPerItemOptions
20
20
  ): ReturnAsyncHook => {
21
- options = makeOptions(options);
21
+ const options = makeOptions(_options);
22
22
  return async (context: HookContext): Promise<HookContext> => {
23
23
  if (shouldSkip("runForItems", context)) { return context; }
24
24
  const { items } = getItemsIsArray(context);