@glassly/jspolyfill 0.4.0-dev.1037 → 0.4.0-dev.1039

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/assets/startup.js CHANGED
@@ -605,7 +605,9 @@
605
605
  }
606
606
  }
607
607
  const sendRequest = g.__sendRequest;
608
- const result = await sendRequest("fetch", "request", [{ url, method, headers, body: bodyString, bodyBase64 }]);
608
+ const result = await sendRequest("fetch", "request", [
609
+ { url, method, headers, body: bodyString, bodyBase64 }
610
+ ]);
609
611
  const bodyText = typeof result.body === "string" ? result.body : "";
610
612
  const responseHeaders = new Map(Object.entries(result.headers ?? {}));
611
613
  class ResponseLike {
package/dist/startup.js CHANGED
@@ -605,7 +605,9 @@
605
605
  }
606
606
  }
607
607
  const sendRequest = g.__sendRequest;
608
- const result = await sendRequest("fetch", "request", [{ url, method, headers, body: bodyString, bodyBase64 }]);
608
+ const result = await sendRequest("fetch", "request", [
609
+ { url, method, headers, body: bodyString, bodyBase64 }
610
+ ]);
609
611
  const bodyText = typeof result.body === "string" ? result.body : "";
610
612
  const responseHeaders = new Map(Object.entries(result.headers ?? {}));
611
613
  class ResponseLike {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glassly/jspolyfill",
3
- "version": "0.4.0-dev.1037",
3
+ "version": "0.4.0-dev.1039",
4
4
  "description": "JSRuntime polyfill bundle — installed into each per-miniapp JSContext (iOS-JSC, Android-QuickJS) at spawn time. Provides browser-like globals (console, timers, fetch, WebSocket, localStorage, crypto.subtle) over a single __dispatch native bridge, plus the __deliver / signalReady plumbing the host runtime relies on.",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/startup.ts CHANGED
@@ -433,8 +433,7 @@ declare const __nativeClearTimer: (token: number) => void
433
433
  }
434
434
  if (env.kind === "ws-event") {
435
435
  const wsHook = (g as Record<string, unknown>).__deliverWebSocketEvent as
436
- | ((sid: string, type: string, payload: Record<string, unknown>) => void)
437
- | undefined
436
+ ((sid: string, type: string, payload: Record<string, unknown>) => void) | undefined
438
437
  const sid = (env as {sid?: string}).sid
439
438
  const wsType = (env as {wsType?: string}).wsType
440
439
  if (typeof wsHook === "function" && typeof sid === "string" && typeof wsType === "string") {
@@ -795,7 +794,9 @@ declare const __nativeClearTimer: (token: number) => void
795
794
  method: string,
796
795
  args: unknown[],
797
796
  ) => Promise<unknown>
798
- const result = (await sendRequest("fetch", "request", [{url, method, headers, body: bodyString, bodyBase64}])) as {
797
+ const result = (await sendRequest("fetch", "request", [
798
+ {url, method, headers, body: bodyString, bodyBase64},
799
+ ])) as {
799
800
  status: number
800
801
  statusText?: string
801
802
  headers?: Record<string, string>
package/src/types.ts CHANGED
@@ -35,8 +35,7 @@ export interface DispatchError {
35
35
  }
36
36
 
37
37
  export type DispatchResponse =
38
- | {reqId: string; ok: true; result: unknown}
39
- | {reqId: string; ok: false; error: DispatchError}
38
+ {reqId: string; ok: true; result: unknown} | {reqId: string; ok: false; error: DispatchError}
40
39
 
41
40
  export type DeliverEnvelope =
42
41
  | {kind: "init"; sessionId: string}