@mxpicture/gcp-functions-common 0.1.29 → 0.1.31

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,2 @@
1
+ import { CallbackAble, DocumentData } from "../types/types.document.js";
2
+ export declare const callableUnwrap: <T extends DocumentData>(c: CallbackAble<T>) => Promise<T>;
@@ -0,0 +1 @@
1
+ export const callableUnwrap = async (c) => (typeof c === "function" ? await c() : c);
@@ -0,0 +1 @@
1
+ export * from "./helper.document.js";
@@ -0,0 +1 @@
1
+ export * from "./helper.document.js";
@@ -8,3 +8,4 @@ export interface DocumentKey {
8
8
  updateTime?: Date;
9
9
  }
10
10
  export type WithKey<DTO extends DocumentData> = DocumentKey & DTO;
11
+ export type CallbackAble<T extends DocumentData> = T | (() => T) | (() => Promise<T>);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/gcp-functions-common",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "Utils for google cloud functions, publishing both CommonJS and ESM builds",
5
5
  "type": "module",
6
6
  "author": "MXPicture",
@@ -14,6 +14,7 @@
14
14
  "./config": "./dist/config/index.js",
15
15
  "./types": "./dist/types/index.js",
16
16
  "./zod": "./dist/zod/index.js",
17
+ "./helper": "./dist/helper/index.js",
17
18
  "./package.json": "./package.json"
18
19
  },
19
20
  "files": [