swarpc 0.15.0 → 0.16.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/dist/server.js CHANGED
@@ -1,45 +1,20 @@
1
- /**
2
- * @module
3
- * @mergeModuleWith <project>
4
- */
5
- /// <reference lib="webworker" />
6
- import { type } from "arktype";
7
1
  import { createLogger, injectIntoConsoleGlobal } from "./log.js";
8
- import { PayloadHeaderSchema, PayloadInitializeSchema, validatePayloadCore as validatePayloadCore, zImplementations, zProcedures, } from "./types.js";
2
+ import { isPayloadHeader, isPayloadInitialize, validatePayloadCore as validatePayloadCore, zImplementations, zProcedures, } from "./types.js";
9
3
  import { findTransferables } from "./utils.js";
10
4
  import { FauxLocalStorage } from "./localstorage.js";
11
5
  import { scopeIsDedicated, scopeIsShared, scopeIsService } from "./scopes.js";
12
6
  import { nodeIdFromScope } from "./nodes.js";
13
7
  const abortControllers = new Map();
14
8
  const abortedRequests = new Set();
15
- /**
16
- * Creates a sw&rpc server instance.
17
- * @param procedures procedures the server will implement, see {@link ProceduresMap}
18
- * @param options various options
19
- * @param options.scope The worker scope to use, defaults to the `self` of the file where Server() is called.
20
- * @param options.loglevel Maximum log level to use, defaults to "debug" (shows everything). "info" will not show debug messages, "warn" will only show warnings and errors, "error" will only show errors.
21
- * @param options._scopeType @internal Don't touch, this is used in testing environments because the mock is subpar. Manually overrides worker scope type detection.
22
- * @returns a SwarpcServer instance. Each property of the procedures map will be a method, that accepts a function implementing the procedure (see {@link ProcedureImplementation}). There is also .start(), to be called after implementing all procedures.
23
- *
24
- * An example of defining a server:
25
- * {@includeCode ../example/src/service-worker.ts}
26
- */
27
9
  export function Server(procedures, { loglevel = "debug", scope, _scopeType, } = {}) {
28
- // If scope is not provided, use the global scope
29
- // This function is meant to be used in a worker, so `self` is a WorkerGlobalScope
30
10
  scope ??= self;
31
- // Service workers don't have a name, but it's fine anyways cuz we don't have multiple nodes when running with a SW
32
11
  const nodeId = nodeIdFromScope(scope, _scopeType);
33
12
  const l = createLogger("server", loglevel, nodeId);
34
- // Initialize the instance.
35
- // Procedures and implementations are stored on properties with symbol keys,
36
- // to avoid any conflicts with procedure names, and also discourage direct access to them.
37
13
  const instance = {
38
14
  [zProcedures]: procedures,
39
15
  [zImplementations]: {},
40
16
  start: async () => { },
41
17
  };
42
- // Set all implementation-setter methods
43
18
  for (const functionName in procedures) {
44
19
  instance[functionName] = ((implementation) => {
45
20
  if (!instance[zProcedures][functionName]) {
@@ -68,7 +43,6 @@ export function Server(procedures, { loglevel = "debug", scope, _scopeType, } =
68
43
  resolve(port);
69
44
  });
70
45
  });
71
- // Used to post messages back to the client
72
46
  const postMessage = async (autotransfer, data) => {
73
47
  const transfer = autotransfer ? [] : findTransferables(data);
74
48
  if (port) {
@@ -84,19 +58,20 @@ export function Server(procedures, { loglevel = "debug", scope, _scopeType, } =
84
58
  }
85
59
  };
86
60
  const listener = async (event) => {
87
- if (PayloadInitializeSchema.allows(event.data)) {
61
+ if (isPayloadInitialize(event.data)) {
88
62
  const { localStorageData, nodeId } = event.data;
89
63
  l.debug(null, "Setting up faux localStorage", localStorageData);
90
64
  new FauxLocalStorage(localStorageData).register(scope);
91
- injectIntoConsoleGlobal(scope, nodeId);
65
+ injectIntoConsoleGlobal(scope, nodeId, null);
92
66
  return;
93
67
  }
94
- // Decode the payload
95
- const { requestId, functionName } = PayloadHeaderSchema(type.enumerated(...Object.keys(procedures))).assert(event.data);
68
+ if (!isPayloadHeader(procedures, event.data)) {
69
+ l.error(null, "Received payload with invalid header", event.data);
70
+ return;
71
+ }
72
+ const { requestId, functionName } = event.data;
96
73
  l.debug(requestId, `Received request for ${functionName}`, event.data);
97
- // Get autotransfer preference from the procedure definition
98
74
  const { autotransfer = "output-only", ...schemas } = instance[zProcedures][functionName];
99
- // Shorthand function with functionName, requestId, etc. set
100
75
  const postMsg = async (data) => {
101
76
  if (abortedRequests.has(requestId))
102
77
  return;
@@ -107,23 +82,19 @@ export function Server(procedures, { loglevel = "debug", scope, _scopeType, } =
107
82
  ...data,
108
83
  });
109
84
  };
110
- // Prepare a function to post errors back to the client
111
85
  const postError = async (error) => postMsg({
112
86
  error: {
113
87
  message: "message" in error ? error.message : String(error),
114
88
  },
115
89
  });
116
- // Retrieve the implementation for the requested function
117
90
  const implementation = instance[zImplementations][functionName];
118
91
  if (!implementation) {
119
92
  await postError("No implementation found");
120
93
  return;
121
94
  }
122
- // Define payload schema for incoming messages
123
95
  const payload = validatePayloadCore(schemas, event.data);
124
96
  if ("isInitializeRequest" in payload)
125
97
  throw "Unreachable: #initialize request payload should've been handled already";
126
- // Handle abortion requests (pro-choice ftw!!)
127
98
  if ("abort" in payload) {
128
99
  const controller = abortControllers.get(requestId);
129
100
  if (!controller)
@@ -131,29 +102,23 @@ export function Server(procedures, { loglevel = "debug", scope, _scopeType, } =
131
102
  controller?.abort(payload.abort.reason);
132
103
  return;
133
104
  }
134
- // Set up the abort controller for this request
135
105
  abortControllers.set(requestId, new AbortController());
136
106
  if (!("input" in payload)) {
137
107
  await postError("No input provided");
138
108
  return;
139
109
  }
140
110
  try {
141
- // Call the implementation with the input and a progress callback
111
+ injectIntoConsoleGlobal(scope, nodeId, requestId);
142
112
  const result = await implementation(payload.input, async (progress) => {
143
- // l.debug(requestId, `Progress for ${functionName}`, progress);
144
113
  await postMsg({ progress });
145
114
  }, {
146
115
  nodeId,
147
116
  abortSignal: abortControllers.get(requestId)?.signal,
148
- logger: createLogger("server", loglevel, nodeId, requestId),
149
117
  });
150
- // Send results
151
118
  l.debug(requestId, `Result for ${functionName}`, result);
152
119
  await postMsg({ result });
153
120
  }
154
121
  catch (error) {
155
- // Send errors
156
- // Handle errors caused by abortions
157
122
  if ("aborted" in error) {
158
123
  l.debug(requestId, `Received abort error for ${functionName}`, error.aborted);
159
124
  abortedRequests.add(requestId);
@@ -167,7 +132,6 @@ export function Server(procedures, { loglevel = "debug", scope, _scopeType, } =
167
132
  abortedRequests.delete(requestId);
168
133
  }
169
134
  };
170
- // Listen for messages from the client
171
135
  if (scopeIsShared(scope, _scopeType)) {
172
136
  if (!port)
173
137
  throw new Error("SharedWorker port not initialized");
@@ -53,4 +53,3 @@ export declare namespace StandardSchemaV1 {
53
53
  /** Infers the output type of a Standard Schema. */
54
54
  type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
55
55
  }
56
- //# sourceMappingURL=standardschema.d.ts.map
package/dist/types.d.ts CHANGED
@@ -3,7 +3,6 @@
3
3
  * @mergeModuleWith <project>
4
4
  */
5
5
  import type { StandardSchemaV1 as Schema } from "./standardschema.js";
6
- import { RequestBoundLogger } from "./log.js";
7
6
  /**
8
7
  * A procedure declaration
9
8
  */
@@ -70,10 +69,6 @@ tools: {
70
69
  * AbortSignal that can be used to handle request cancellation -- see [Make cancellable requests](https://gwennlbh.github.io/swarpc/docs/#make-cancelable-requests)
71
70
  */
72
71
  abortSignal?: AbortSignal;
73
- /**
74
- * Logger instance to use for logging messages related to this procedure call, using the same format as SWARPC's built-in logging.
75
- */
76
- logger: RequestBoundLogger;
77
72
  /**
78
73
  * ID of the Node the request is being processed on.
79
74
  */
@@ -86,12 +81,6 @@ tools: {
86
81
  * {@includeCode ../example/src/lib/procedures.ts}
87
82
  */
88
83
  export type ProceduresMap = Record<string, Procedure<Schema, Schema, Schema>>;
89
- /**
90
- * Implementations of procedures by name
91
- */
92
- export type ImplementationsMap<Procedures extends ProceduresMap> = {
93
- [F in keyof Procedures]: ProcedureImplementation<Procedures[F]["input"], Procedures[F]["progress"], Procedures[F]["success"]>;
94
- };
95
84
  /**
96
85
  * Declaration of hooks to run on messages received from the server
97
86
  */
@@ -109,41 +98,6 @@ export type Hooks<Procedures extends ProceduresMap> = {
109
98
  */
110
99
  progress?: <Procedure extends keyof ProceduresMap>(procedure: Procedure, data: Schema.InferOutput<Procedures[Procedure]["progress"]>) => void;
111
100
  };
112
- export declare const PayloadInitializeSchema: import("arktype/internal/variants/object.ts").ObjectType<{
113
- by: "sw&rpc";
114
- functionName: "#initialize";
115
- isInitializeRequest: true;
116
- localStorageData: Record<string, unknown>;
117
- nodeId: string;
118
- }, {}>;
119
- export type PayloadInitialize = typeof PayloadInitializeSchema.infer;
120
- /**
121
- * @source
122
- */
123
- export declare const PayloadHeaderSchema: import("arktype").Generic<[["Name", string]], {
124
- readonly by: "\"sw&rpc\"";
125
- readonly functionName: "Name";
126
- readonly requestId: "string >= 1";
127
- }, {}, {}>;
128
- export type PayloadHeader<PM extends ProceduresMap, Name extends keyof PM = keyof PM> = {
129
- by: "sw&rpc";
130
- functionName: Name & string;
131
- requestId: string;
132
- };
133
- /**
134
- * @source
135
- */
136
- export declare const PayloadCoreSchema: import("arktype").Generic<[["I", unknown], ["P", unknown], ["S", unknown]], {
137
- readonly "input?": "I";
138
- readonly "progress?": "P";
139
- readonly "result?": "S";
140
- readonly "abort?": {
141
- readonly reason: "string";
142
- };
143
- readonly "error?": {
144
- readonly message: "string";
145
- };
146
- }, {}, {}>;
147
101
  export type PayloadCore<PM extends ProceduresMap, Name extends keyof PM = keyof PM> = {
148
102
  input: Schema.InferOutput<PM[Name]["input"]>;
149
103
  } | {
@@ -159,14 +113,6 @@ export type PayloadCore<PM extends ProceduresMap, Name extends keyof PM = keyof
159
113
  message: string;
160
114
  };
161
115
  };
162
- /**
163
- * @source
164
- */
165
- export declare function validatePayloadCore<PM extends ProceduresMap, Name extends keyof PM>(procedure: PM[Name], payload: unknown): PayloadCore<PM, keyof PM>;
166
- /**
167
- * The effective payload as sent by the server to the client
168
- */
169
- export type Payload<PM extends ProceduresMap, Name extends keyof PM = keyof PM> = (PayloadHeader<PM, Name> & PayloadCore<PM, Name>) | PayloadInitialize;
170
116
  /**
171
117
  * A procedure's corresponding method on the client instance -- used to call the procedure. If you want to be able to cancel the request, you can use the `cancelable` method instead of running the procedure directly.
172
118
  */
@@ -188,21 +134,8 @@ export type ClientMethod<P extends Procedure<Schema, Schema, Schema>> = ((input:
188
134
  node: string;
189
135
  }>>;
190
136
  };
191
- /**
192
- * Symbol used as the key for the procedures map on the server instance
193
- * @internal
194
- * @source
195
- */
196
- export declare const zImplementations: unique symbol;
197
- /**
198
- * Symbol used as the key for the procedures map on instances
199
- * @internal
200
- * @source
201
- */
202
- export declare const zProcedures: unique symbol;
203
137
  export type WorkerConstructor<T extends Worker | SharedWorker = Worker | SharedWorker> = {
204
138
  new (opts?: {
205
139
  name?: string;
206
140
  }): T;
207
141
  };
208
- //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -1,37 +1,53 @@
1
- /**
2
- * @module
3
- * @mergeModuleWith <project>
4
- */
5
- import { ArkErrors, type } from "arktype";
6
- export const PayloadInitializeSchema = type({
7
- by: '"sw&rpc"',
8
- functionName: '"#initialize"',
9
- isInitializeRequest: "true",
10
- localStorageData: "Record<string, unknown>",
11
- nodeId: "string",
12
- });
13
- /**
14
- * @source
15
- */
16
- export const PayloadHeaderSchema = type("<Name extends string>", {
17
- by: '"sw&rpc"',
18
- functionName: "Name",
19
- requestId: "string >= 1",
20
- });
21
- /**
22
- * @source
23
- */
24
- export const PayloadCoreSchema = type("<I, P, S>", {
25
- "input?": "I",
26
- "progress?": "P",
27
- "result?": "S",
28
- "abort?": { reason: "string" },
29
- "error?": { message: "string" },
30
- });
31
- const AbortOrError = type.or({ abort: { reason: "string" } }, { error: { message: "string" } });
32
- /**
33
- * @source
34
- */
1
+ export function isPayloadInitialize(payload) {
2
+ if (typeof payload !== "object")
3
+ return false;
4
+ if (payload === null)
5
+ return false;
6
+ if (!("by" in payload))
7
+ return false;
8
+ if (!("nodeId" in payload))
9
+ return false;
10
+ if (!("functionName" in payload))
11
+ return false;
12
+ if (!("localStorageData" in payload))
13
+ return false;
14
+ if (!("isInitializeRequest" in payload))
15
+ return false;
16
+ if (payload.by !== "sw&rpc")
17
+ return false;
18
+ if (payload.functionName !== "#initialize")
19
+ return false;
20
+ if (payload.isInitializeRequest !== true)
21
+ return false;
22
+ if (typeof payload.nodeId !== "string")
23
+ return false;
24
+ if (typeof payload.localStorageData !== "object")
25
+ return false;
26
+ if (payload.localStorageData === null)
27
+ return false;
28
+ return true;
29
+ }
30
+ export function isPayloadHeader(procedures, payload) {
31
+ if (typeof payload !== "object")
32
+ return false;
33
+ if (payload === null)
34
+ return false;
35
+ if (!("by" in payload))
36
+ return false;
37
+ if (!("requestId" in payload))
38
+ return false;
39
+ if (!("functionName" in payload))
40
+ return false;
41
+ if (payload.by !== "sw&rpc")
42
+ return false;
43
+ if (typeof payload.requestId !== "string")
44
+ return false;
45
+ if (typeof payload.functionName !== "string")
46
+ return false;
47
+ if (!Object.keys(procedures).includes(payload.functionName))
48
+ return false;
49
+ return true;
50
+ }
35
51
  export function validatePayloadCore(procedure, payload) {
36
52
  if (typeof payload !== "object")
37
53
  throw new Error("payload is not an object");
@@ -52,21 +68,21 @@ export function validatePayloadCore(procedure, payload) {
52
68
  if ("value" in result)
53
69
  return { result: result.value };
54
70
  }
55
- const abortOrError = AbortOrError(payload);
56
- if (!(abortOrError instanceof ArkErrors)) {
57
- return abortOrError;
71
+ if ("abort" in payload &&
72
+ typeof payload.abort === "object" &&
73
+ payload.abort !== null &&
74
+ "reason" in payload.abort &&
75
+ typeof payload.abort.reason === "string") {
76
+ return { abort: { reason: payload.abort.reason } };
77
+ }
78
+ if ("error" in payload &&
79
+ typeof payload.error === "object" &&
80
+ payload.error !== null &&
81
+ "message" in payload.error &&
82
+ typeof payload.error.message === "string") {
83
+ return { error: { message: payload.error.message } };
58
84
  }
59
85
  throw new Error("invalid payload");
60
86
  }
61
- /**
62
- * Symbol used as the key for the procedures map on the server instance
63
- * @internal
64
- * @source
65
- */
66
87
  export const zImplementations = Symbol("SWARPC implementations");
67
- /**
68
- * Symbol used as the key for the procedures map on instances
69
- * @internal
70
- * @source
71
- */
72
88
  export const zProcedures = Symbol("SWARPC procedures");
package/dist/utils.d.ts CHANGED
@@ -1,2 +1 @@
1
- export declare function findTransferables(value: any): Transferable[];
2
- //# sourceMappingURL=utils.d.ts.map
1
+ export {};
package/dist/utils.js CHANGED
@@ -1,4 +1,3 @@
1
- // TODO: keep it in sync with web standards, how?
2
1
  const transferableClasses = [
3
2
  MessagePort,
4
3
  ReadableStream,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swarpc",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Full type-safe RPC library for service worker -- move things off of the UI thread with ease!",
5
5
  "keywords": [
6
6
  "service-workers",
@@ -21,13 +21,18 @@
21
21
  "author": "Gwenn Le Bihan <gwenn.lebihan7@gmail.com>",
22
22
  "type": "module",
23
23
  "files": [
24
- "dist",
25
- "src"
24
+ "dist"
26
25
  ],
27
26
  "main": "dist/index.js",
28
27
  "types": "dist/index.d.ts",
28
+ "size-limit": [
29
+ {
30
+ "path": "dist/index.js",
31
+ "limit": "5 kB"
32
+ }
33
+ ],
29
34
  "scripts": {
30
- "build": "tsc",
35
+ "build": "tsc --removeComments --declaration false && tsc --emitDeclarationOnly",
31
36
  "dev": "tsc --watch",
32
37
  "typecheck": "tsc --noEmit",
33
38
  "test": "vitest",
@@ -43,7 +48,10 @@
43
48
  "devDependencies": {
44
49
  "@8hobbies/typedoc-plugin-plausible": "^2.2.0",
45
50
  "@playwright/test": "^1.56.1",
51
+ "@size-limit/esbuild-why": "^11.2.0",
52
+ "@size-limit/preset-small-lib": "^11.2.0",
46
53
  "@vitest/web-worker": "^4.0.6",
54
+ "arktype": "^2.1.25",
47
55
  "date-fns": "^4.1.0",
48
56
  "husky": "^9.1.7",
49
57
  "kacl": "^1.1.1",
@@ -54,6 +62,7 @@
54
62
  "pkg-pr-new": "^0.0.60",
55
63
  "prettier": "^3.6.2",
56
64
  "sirv-cli": "^3.0.1",
65
+ "size-limit": "^11.2.0",
57
66
  "typedoc": "^0.28.14",
58
67
  "typedoc-material-theme": "^1.4.1",
59
68
  "typedoc-plugin-dt-links": "^2.0.27",
@@ -74,8 +83,5 @@
74
83
  "oxlint --fix",
75
84
  "prettier --write"
76
85
  ]
77
- },
78
- "dependencies": {
79
- "arktype": "^2.1.25"
80
86
  }
81
87
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,kBAAkB,EAClB,KAAK,MAAM,EACX,KAAK,QAAQ,EACd,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,YAAY,EACZ,KAAK,EACL,OAAO,EAEP,iBAAiB,EACjB,WAAW,EACX,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAGpB;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,SAAS,aAAa,IAAI;IAC3D,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;CAC3B,GAAG;KACD,CAAC,IAAI,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,KAAK,OAAO,CAAC,UAAU,SAAS,aAAa,IAAI;IAC/C,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IACxC,gCAAgC;IAChC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kCAAkC;IAClC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC;AAQF,MAAM,MAAM,cAAc,GAAG;IAC3B,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7B,UAAU,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,CAAC,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C;AAC5B,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"localstorage.d.ts","sourceRoot":"","sources":["../src/localstorage.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAgB;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAC;gBAER,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKrC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKlC,OAAO,CAAC,GAAG,EAAE,MAAM;IAInB,OAAO,CAAC,GAAG,EAAE,MAAM;IAInB,UAAU,CAAC,GAAG,EAAE,MAAM;IAMtB,KAAK;IAKL,GAAG,CAAC,KAAK,EAAE,MAAM;IAIjB,IAAI,MAAM,WAET;IAED,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,uBAAuB;CAI9D"}
package/dist/log.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,GAAG,QAAQ,EACzB,KAAK,EAAE,QAAQ,EACf,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CAAC;AACV,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,GAAG,QAAQ,EACzB,KAAK,EAAE,QAAQ,EACf,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,kBAAkB,CAAC;AA2BtB;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACtE,IA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B,WAAW,CACzB,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,GACpC,SAAS,GAAG,MAAM,CA0BpB;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,iBAAiB,EACxB,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAC9C,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,QAAA,MAAM,mBAAmB,EAAG,MAAe,CAAC;AAE5C,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,GAAG,SAAS,GACrB,MAAM,GAAG,OAAO,mBAAmB,CAErC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../src/polyfills.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAaA,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,EACxB,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAC9C,KAAK,IAAI,uBAAuB,CAElC;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,iBAAiB,EACxB,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAC9C,KAAK,IAAI,0BAA0B,CAIrC;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,iBAAiB,EACxB,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAC9C,KAAK,IAAI,wBAAwB,CAEnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAyC,KAAK,QAAQ,EAAE,MA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