socket-function 0.103.0 → 0.105.0
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/SocketFunction.ts +5 -1
- package/package.json +1 -1
- package/src/misc.ts +7 -0
package/SocketFunction.ts
CHANGED
|
@@ -441,8 +441,12 @@ export class SocketFunction {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
declare global {
|
|
445
|
+
var BOOTED_EDGE_NODE: { host: string } | undefined;
|
|
446
|
+
}
|
|
447
|
+
|
|
444
448
|
function getBootedEdgeNode() {
|
|
445
|
-
return
|
|
449
|
+
return BOOTED_EDGE_NODE as { host: string } | undefined;
|
|
446
450
|
}
|
|
447
451
|
|
|
448
452
|
|
package/package.json
CHANGED
package/src/misc.ts
CHANGED
|
@@ -445,3 +445,10 @@ export function timeoutToUndefinedSilent<T>(time: number, p: Promise<T>) {
|
|
|
445
445
|
).finally(() => clearTimeout(timeout));
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
|
+
|
|
449
|
+
export function errorToWarning<T>(promise: Promise<T>): Promise<T | undefined> {
|
|
450
|
+
return promise.catch(e => {
|
|
451
|
+
console.warn(e.stack);
|
|
452
|
+
return undefined as any;
|
|
453
|
+
});
|
|
454
|
+
}
|