@faasjs/func 0.0.2-beta.397 → 0.0.2-beta.398

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.
package/dist/index.js CHANGED
@@ -194,6 +194,15 @@ var plugins = [];
194
194
  function usePlugin(plugin) {
195
195
  if (!plugins.find((p) => p.name === plugin.name))
196
196
  plugins.push(plugin);
197
+ if (!plugin.mount)
198
+ plugin.mount = async function({ config }) {
199
+ if (plugin.onMount)
200
+ await plugin.onMount({
201
+ config,
202
+ event: {},
203
+ context: {}
204
+ }, async () => Promise.resolve());
205
+ };
197
206
  return plugin;
198
207
  }
199
208
  function useFunc(handler) {
package/dist/index.mjs CHANGED
@@ -168,6 +168,15 @@ var plugins = [];
168
168
  function usePlugin(plugin) {
169
169
  if (!plugins.find((p) => p.name === plugin.name))
170
170
  plugins.push(plugin);
171
+ if (!plugin.mount)
172
+ plugin.mount = async function({ config }) {
173
+ if (plugin.onMount)
174
+ await plugin.onMount({
175
+ config,
176
+ event: {},
177
+ context: {}
178
+ }, async () => Promise.resolve());
179
+ };
171
180
  return plugin;
172
181
  }
173
182
  function useFunc(handler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/func",
3
- "version": "0.0.2-beta.397",
3
+ "version": "0.0.2-beta.398",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/deep_merge": "^0.0.2-beta.397",
26
- "@faasjs/logger": "^0.0.2-beta.397"
25
+ "@faasjs/deep_merge": "^0.0.2-beta.398",
26
+ "@faasjs/logger": "^0.0.2-beta.398"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsup": "*",