feathers-utils 1.7.1 → 1.7.2
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,4 @@
|
|
|
1
1
|
import type { HookRunPerItemOptions } from "../types";
|
|
2
2
|
import type { HookContext } from "@feathersjs/feathers";
|
|
3
|
-
|
|
3
|
+
import type { Promisable } from "type-fest";
|
|
4
|
+
export declare const runPerItem: (actionPerItem: (item: any, context: HookContext) => Promisable<any>, options: HookRunPerItemOptions) => (context: HookContext) => Promise<HookContext>;
|
package/dist/esm/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>>) =>
|
|
7
|
+
runPerItem: (actionPerItem: (item: any, context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => any, options: import("./types").HookRunPerItemOptions) => (context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => Promise<import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>>;
|
|
8
8
|
};
|
|
9
9
|
export { checkMulti };
|
|
10
10
|
export { setData };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { HookRunPerItemOptions } from "../types";
|
|
2
2
|
import type { HookContext } from "@feathersjs/feathers";
|
|
3
|
-
|
|
3
|
+
import type { Promisable } from "type-fest";
|
|
4
|
+
export declare const runPerItem: (actionPerItem: (item: any, context: HookContext) => Promisable<any>, options: HookRunPerItemOptions) => (context: HookContext) => Promise<HookContext>;
|
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>>) =>
|
|
7
|
+
runPerItem: (actionPerItem: (item: any, context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => any, options: import("./types").HookRunPerItemOptions) => (context: import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>) => Promise<import("@feathersjs/feathers").HookContext<any, import("@feathersjs/feathers").Service<any>>>;
|
|
8
8
|
};
|
|
9
9
|
export { checkMulti };
|
|
10
10
|
export { setData };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feathers-utils",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Some utils for projects using '@feathersjs/feathers'",
|
|
5
5
|
"author": "fratzinger",
|
|
6
6
|
"repository": {
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"@feathersjs/errors": "^4.5.11",
|
|
36
36
|
"@feathersjs/feathers": "^4.5.11",
|
|
37
37
|
"feathers-hooks-common": "^5.0.5",
|
|
38
|
-
"lodash": "^4.17.21"
|
|
38
|
+
"lodash": "^4.17.21",
|
|
39
|
+
"type-fest": "^2.5.4"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
package/src/hooks/runPerItem.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { shouldSkip } from "../utils/shouldSkip";
|
|
|
4
4
|
|
|
5
5
|
import type { HookRunPerItemOptions } from "../types";
|
|
6
6
|
import type { HookContext } from "@feathersjs/feathers";
|
|
7
|
+
import type { Promisable } from "type-fest";
|
|
7
8
|
|
|
8
9
|
const makeOptions = (
|
|
9
10
|
options: HookRunPerItemOptions
|
|
@@ -15,7 +16,7 @@ const makeOptions = (
|
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const runPerItem = (
|
|
18
|
-
actionPerItem: (item: any, context: HookContext) =>
|
|
19
|
+
actionPerItem: (item: any, context: HookContext) => Promisable<any>,
|
|
19
20
|
options: HookRunPerItemOptions
|
|
20
21
|
): ((context: HookContext) => Promise<HookContext>) => {
|
|
21
22
|
options = makeOptions(options);
|