@vercel/functions 1.0.0 → 1.0.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.
- package/index.d.ts +1 -1
- package/index.js +2 -10
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* global globalThis */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
exports.waitUntil = promise => {
|
|
4
4
|
if (
|
|
5
|
-
promise instanceof Promise === false ||
|
|
6
5
|
promise === null ||
|
|
7
6
|
typeof promise !== 'object' ||
|
|
8
7
|
typeof promise.then !== 'function'
|
|
@@ -13,12 +12,5 @@ export const waitUntil = promise => {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
const ctx = globalThis[Symbol.for('@vercel/request-context')]?.get?.() ?? {};
|
|
16
|
-
|
|
17
|
-
if (!ctx.waitUntil) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
'failed to get waitUntil function for this request context'
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
ctx.waitUntil(promise);
|
|
15
|
+
ctx.waitUntil?.(promise);
|
|
24
16
|
};
|
package/package.json
CHANGED