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 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 (globalThis as any).BOOTED_EDGE_NODE as { host: string } | undefined;
449
+ return BOOTED_EDGE_NODE as { host: string } | undefined;
446
450
  }
447
451
 
448
452
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.103.0",
3
+ "version": "0.105.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
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
+ }