@vnejs/helpers.call-all-promises 0.1.1

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.
@@ -0,0 +1 @@
1
+ export declare const callAllPromises: <T, R>(fns: Array<((arg: T) => R | Promise<R>) | (() => R | Promise<R>)>, arg?: T) => Promise<R[]>;
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { invokeThunk } from "@vnejs/helpers.invoke-thunk";
2
+ export const callAllPromises = (fns, arg) => Promise.all(arg === undefined
3
+ ? fns.map(invokeThunk)
4
+ : fns.map((fn) => invokeThunk(() => fn(arg))));
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@vnejs/helpers.call-all-promises",
3
+ "version": "0.1.1",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "rm -rf dist && tsc -p tsconfig.json",
13
+ "publish:major:plugin": "npm run publish:major",
14
+ "publish:minor:plugin": "npm run publish:minor",
15
+ "publish:patch:plugin": "npm run publish:patch",
16
+ "publish:major": "npm run build && npm version major && npm publish --access public",
17
+ "publish:minor": "npm run build && npm version minor && npm publish --access public",
18
+ "publish:patch": "npm run build && npm version patch && npm publish --access public"
19
+ },
20
+ "author": "",
21
+ "license": "ISC",
22
+ "dependencies": {
23
+ "@vnejs/helpers.invoke-thunk": "~0.1.0"
24
+ },
25
+ "devDependencies": {
26
+ "typescript": "^6.0.3"
27
+ }
28
+ }