firebird-wasm 0.2.0 → 0.4.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/CHANGELOG.md +199 -0
- package/README.md +4 -1
- package/dist/.tsbuildinfo.build +1 -1
- package/dist/browser/engine-transport.d.ts +63 -5
- package/dist/browser/engine-transport.d.ts.map +1 -1
- package/dist/browser/engine-transport.js +290 -8
- package/dist/browser/engine-transport.js.map +1 -1
- package/dist/browser/firebird-browser.d.ts +252 -7
- package/dist/browser/firebird-browser.d.ts.map +1 -1
- package/dist/browser/firebird-browser.js +373 -20
- package/dist/browser/firebird-browser.js.map +1 -1
- package/dist/browser/index.d.ts +8 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +19 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/opfs-fs.d.ts +72 -0
- package/dist/browser/opfs-fs.d.ts.map +1 -0
- package/dist/browser/opfs-fs.js +249 -0
- package/dist/browser/opfs-fs.js.map +1 -0
- package/dist/browser/params.d.ts +30 -3
- package/dist/browser/params.d.ts.map +1 -1
- package/dist/browser/params.js +97 -22
- package/dist/browser/params.js.map +1 -1
- package/dist/browser/shared-transport.d.ts +9 -2
- package/dist/browser/shared-transport.d.ts.map +1 -1
- package/dist/browser/shared-transport.js +33 -2
- package/dist/browser/shared-transport.js.map +1 -1
- package/dist/browser/statement-types.d.ts +18 -0
- package/dist/browser/statement-types.d.ts.map +1 -0
- package/dist/browser/statement-types.js +39 -0
- package/dist/browser/statement-types.js.map +1 -0
- package/dist/browser/value-types.d.ts +173 -0
- package/dist/browser/value-types.d.ts.map +1 -0
- package/dist/browser/value-types.js +222 -0
- package/dist/browser/value-types.js.map +1 -0
- package/dist/browser/worker-entry.d.ts.map +1 -1
- package/dist/browser/worker-entry.js +38 -1
- package/dist/browser/worker-entry.js.map +1 -1
- package/dist/browser/worker-protocol.d.ts +1 -1
- package/dist/browser/worker-protocol.d.ts.map +1 -1
- package/dist/browser/worker-transport.d.ts +9 -2
- package/dist/browser/worker-transport.d.ts.map +1 -1
- package/dist/browser/worker-transport.js +29 -2
- package/dist/browser/worker-transport.js.map +1 -1
- package/dist/firebird.d.ts +69 -5
- package/dist/firebird.d.ts.map +1 -1
- package/dist/firebird.js +187 -49
- package/dist/firebird.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/sql-tag.d.ts +184 -0
- package/dist/sql-tag.d.ts.map +1 -0
- package/dist/sql-tag.js +287 -0
- package/dist/sql-tag.js.map +1 -0
- package/dist/statement-types.d.ts +23 -0
- package/dist/statement-types.d.ts.map +1 -0
- package/dist/statement-types.js +44 -0
- package/dist/statement-types.js.map +1 -0
- package/dist/types.d.ts +62 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/wasm/firebird-embedded.js +1 -1
- package/dist/wasm/firebird-embedded.wasm +0 -0
- package/dist/wasm-loader.d.ts +44 -2
- package/dist/wasm-loader.d.ts.map +1 -1
- package/dist/wasm-loader.js.map +1 -1
- package/package.json +3 -2
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* leader may have committed it and died before the reply, so re-issuing could
|
|
27
27
|
* apply it twice. An error a caller can see beats a duplicate row it cannot.
|
|
28
28
|
*/
|
|
29
|
-
import type { Row, QueryResult, QueryParams, TransactionOptions } from '../types';
|
|
29
|
+
import type { Row, QueryResult, QueryDescription, QueryParams, RowMode, TransactionOptions } from '../types';
|
|
30
30
|
import type { EngineHandle, EngineTransport } from './engine-transport';
|
|
31
31
|
/** Options for {@link SharedEngineTransport}. */
|
|
32
32
|
export interface SharedEngineTransportOptions {
|
|
@@ -115,7 +115,9 @@ export declare class SharedEngineTransport implements EngineTransport {
|
|
|
115
115
|
attachDatabase(path: string): Promise<EngineHandle>;
|
|
116
116
|
detachDatabase(dbHandle: EngineHandle): Promise<void>;
|
|
117
117
|
execute(dbHandle: EngineHandle, txHandle: EngineHandle, sql: string, params?: QueryParams): Promise<number>;
|
|
118
|
-
|
|
118
|
+
executeBatch(dbHandle: EngineHandle, txHandle: EngineHandle, sql: string, rows: QueryParams[]): Promise<number>;
|
|
119
|
+
query<T = Row>(dbHandle: EngineHandle, txHandle: EngineHandle, sql: string, params?: QueryParams, rowMode?: RowMode, binaryBlobs?: boolean): Promise<QueryResult<T>>;
|
|
120
|
+
describe(dbHandle: EngineHandle, txHandle: EngineHandle, sql: string): Promise<QueryDescription>;
|
|
119
121
|
startTransaction(dbHandle: EngineHandle, options?: TransactionOptions): Promise<EngineHandle>;
|
|
120
122
|
commit(txHandle: EngineHandle): Promise<void>;
|
|
121
123
|
rollback(txHandle: EngineHandle): Promise<void>;
|
|
@@ -123,6 +125,11 @@ export declare class SharedEngineTransport implements EngineTransport {
|
|
|
123
125
|
exists(path: string): Promise<boolean>;
|
|
124
126
|
readFile(path: string): Promise<Uint8Array>;
|
|
125
127
|
writeFile(path: string, data: Uint8Array): Promise<void>;
|
|
128
|
+
unlink(path: string): Promise<void>;
|
|
129
|
+
eventsSubscribe(dbHandle: EngineHandle, names: string[]): Promise<number>;
|
|
130
|
+
eventsPoll(subscription: number): Promise<Record<string, number>>;
|
|
131
|
+
eventsCancel(subscription: number): Promise<void>;
|
|
132
|
+
mountOpfs(dbName: string): Promise<string>;
|
|
126
133
|
dispose(): Promise<void>;
|
|
127
134
|
}
|
|
128
135
|
//# sourceMappingURL=shared-transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-transport.d.ts","sourceRoot":"","sources":["../../src/browser/shared-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"shared-transport.d.ts","sourceRoot":"","sources":["../../src/browser/shared-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACV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d,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,YAAY,CAAC;IAIxB,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI3C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInC,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzE,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAIjE,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKpC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB/B"}
|
|
@@ -40,12 +40,16 @@ const leader_election_1 = require("./leader-election");
|
|
|
40
40
|
const REPLAYABLE = new Set([
|
|
41
41
|
'init',
|
|
42
42
|
'query',
|
|
43
|
+
// Prepares a statement and drops it, executing nothing, so re-issuing it is
|
|
44
|
+
// indistinguishable from issuing it once.
|
|
45
|
+
'describe',
|
|
43
46
|
'exists',
|
|
44
47
|
'readFile',
|
|
45
48
|
]);
|
|
46
49
|
/** Ops that change the database, and so make the leader's image dirty. */
|
|
47
50
|
const MUTATING = new Set([
|
|
48
51
|
'execute',
|
|
52
|
+
'executeBatch',
|
|
49
53
|
'commit',
|
|
50
54
|
'createDatabase',
|
|
51
55
|
'writeFile',
|
|
@@ -292,8 +296,19 @@ class SharedEngineTransport {
|
|
|
292
296
|
execute(dbHandle, txHandle, sql, params = []) {
|
|
293
297
|
return this.call('execute', dbHandle, txHandle, sql, params);
|
|
294
298
|
}
|
|
295
|
-
|
|
296
|
-
return this.call('
|
|
299
|
+
executeBatch(dbHandle, txHandle, sql, rows) {
|
|
300
|
+
return this.call('executeBatch', dbHandle, txHandle, sql, rows);
|
|
301
|
+
}
|
|
302
|
+
query(dbHandle, txHandle, sql, params = [], rowMode = 'object', binaryBlobs = false) {
|
|
303
|
+
// Decoding happens on the far side, so both of these have to travel with
|
|
304
|
+
// the call rather than being applied to what comes back. They are a string
|
|
305
|
+
// and a boolean, so they survive structured cloning like the rest of the
|
|
306
|
+
// arguments — and the Uint8Arrays that come back from a side-channelled
|
|
307
|
+
// BLOB survive it too, which is what made this placement possible.
|
|
308
|
+
return this.call('query', dbHandle, txHandle, sql, params, rowMode, binaryBlobs);
|
|
309
|
+
}
|
|
310
|
+
describe(dbHandle, txHandle, sql) {
|
|
311
|
+
return this.call('describe', dbHandle, txHandle, sql);
|
|
297
312
|
}
|
|
298
313
|
startTransaction(dbHandle, options = {}) {
|
|
299
314
|
return this.call('startTransaction', dbHandle, options);
|
|
@@ -316,6 +331,22 @@ class SharedEngineTransport {
|
|
|
316
331
|
writeFile(path, data) {
|
|
317
332
|
return this.call('writeFile', path, data);
|
|
318
333
|
}
|
|
334
|
+
unlink(path) {
|
|
335
|
+
return this.call('unlink', path);
|
|
336
|
+
}
|
|
337
|
+
eventsSubscribe(dbHandle, names) {
|
|
338
|
+
return this.call('eventsSubscribe', dbHandle, names);
|
|
339
|
+
}
|
|
340
|
+
eventsPoll(subscription) {
|
|
341
|
+
return this.call('eventsPoll', subscription);
|
|
342
|
+
}
|
|
343
|
+
eventsCancel(subscription) {
|
|
344
|
+
return this.call('eventsCancel', subscription);
|
|
345
|
+
}
|
|
346
|
+
mountOpfs(dbName) {
|
|
347
|
+
// The mount happens on the far side; only the resulting path comes back.
|
|
348
|
+
return this.call('mountOpfs', dbName);
|
|
349
|
+
}
|
|
319
350
|
async dispose() {
|
|
320
351
|
if (this.disposed)
|
|
321
352
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-transport.js","sourceRoot":"","sources":["../../src/browser/shared-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;
|
|
1
|
+
{"version":3,"file":"shared-transport.js","sourceRoot":"","sources":["../../src/browser/shared-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AAWH,uDAAgD;AA6ChD;;;;;;GAMG;AACH,MAAM,UAAU,GAA0B,IAAI,GAAG,CAAW;IAC1D,MAAM;IACN,OAAO;IACP,4EAA4E;IAC5E,0CAA0C;IAC1C,UAAU;IACV,QAAQ;IACR,UAAU;CACX,CAAC,CAAC;AA2CH,0EAA0E;AAC1E,MAAM,QAAQ,GAA0B,IAAI,GAAG,CAAW;IACxD,SAAS;IACT,cAAc;IACd,QAAQ;IACR,gBAAgB;IAChB,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,MAAO,CAAC;AAcnC;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IA0BhC,YAAY,OAAqC;QAfjD,sEAAsE;QAC9D,WAAM,GAA2B,IAAI,CAAC;QAE7B,YAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;QAC9C,eAAU,GAAG,CAAC,CAAC;QACf,aAAQ,GAAG,KAAK,CAAC;QAEzB,8EAA8E;QACtE,UAAK,GAAG,CAAC,CAAC;QAClB,0EAA0E;QAClE,cAAS,GAAG,KAAK,CAAC;QAgG1B,0EA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E,YAAY,CAAC,CAAC;IACvE,CAAC;IAED,YAAY,CAAC,YAAoB;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAO,cAAc,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,yEAAyE;QACzE,OAAO,IAAI,CAAC,IAAI,CAAS,WAAW,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACpC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAErB,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,yEAAyE;QACzE,mEAAmE;QACnE,MAAM,MAAM,EAAE,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CACF;AA5ZD,sDA4ZC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* statement-types.ts – names for Firebird's statement-type codes.
|
|
3
|
+
*
|
|
4
|
+
* The engine reports what a statement *is* as one of the `isc_info_sql_stmt_*`
|
|
5
|
+
* constants. A caller asking `describeQuery()` what they have wants the name,
|
|
6
|
+
* not the number — the number is only meaningful next to a copy of
|
|
7
|
+
* `iberror.h`.
|
|
8
|
+
*/
|
|
9
|
+
import type { StatementKind } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* Name a statement-type code.
|
|
12
|
+
*
|
|
13
|
+
* An unrecognised code is `'UNKNOWN'` rather than an error: a Firebird release
|
|
14
|
+
* may add one, and a name this library has not learned yet is no reason to
|
|
15
|
+
* fail a description that is otherwise complete.
|
|
16
|
+
*/
|
|
17
|
+
export declare function statementKind(code: number): StatementKind;
|
|
18
|
+
//# sourceMappingURL=statement-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-types.d.ts","sourceRoot":"","sources":["../../src/browser/statement-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoB9C;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAEzD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* statement-types.ts – names for Firebird's statement-type codes.
|
|
4
|
+
*
|
|
5
|
+
* The engine reports what a statement *is* as one of the `isc_info_sql_stmt_*`
|
|
6
|
+
* constants. A caller asking `describeQuery()` what they have wants the name,
|
|
7
|
+
* not the number — the number is only meaningful next to a copy of
|
|
8
|
+
* `iberror.h`.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.statementKind = statementKind;
|
|
12
|
+
// From firebird/impl/consts_pub.h (isc_info_sql_stmt_*).
|
|
13
|
+
const NAMES = {
|
|
14
|
+
1: 'SELECT',
|
|
15
|
+
2: 'INSERT',
|
|
16
|
+
3: 'UPDATE',
|
|
17
|
+
4: 'DELETE',
|
|
18
|
+
5: 'DDL',
|
|
19
|
+
6: 'GET_SEGMENT',
|
|
20
|
+
7: 'PUT_SEGMENT',
|
|
21
|
+
8: 'EXEC_PROCEDURE',
|
|
22
|
+
9: 'START_TRANS',
|
|
23
|
+
10: 'COMMIT',
|
|
24
|
+
11: 'ROLLBACK',
|
|
25
|
+
12: 'SELECT_FOR_UPD',
|
|
26
|
+
13: 'SET_GENERATOR',
|
|
27
|
+
14: 'SAVEPOINT',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Name a statement-type code.
|
|
31
|
+
*
|
|
32
|
+
* An unrecognised code is `'UNKNOWN'` rather than an error: a Firebird release
|
|
33
|
+
* may add one, and a name this library has not learned yet is no reason to
|
|
34
|
+
* fail a description that is otherwise complete.
|
|
35
|
+
*/
|
|
36
|
+
function statementKind(code) {
|
|
37
|
+
return NAMES[code] ?? 'UNKNOWN';
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=statement-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-types.js","sourceRoot":"","sources":["../../src/browser/statement-types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA6BH,sCAEC;AA3BD,yDAAyD;AACzD,MAAM,KAAK,GAAkC;IAC3C,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,gBAAgB;IACnB,CAAC,EAAE,aAAa;IAChB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,WAAW;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* value-types.ts – opt-in conversion of result values to richer JavaScript types.
|
|
3
|
+
*
|
|
4
|
+
* The wire format hands back values that are always *correct* and sometimes
|
|
5
|
+
* awkward: a `BIGINT` past 2⁵³ is an exact decimal string, a binary `BLOB` is
|
|
6
|
+
* base64, a `TIMESTAMP` is ISO-8601 text. Nothing is lost, but nothing is
|
|
7
|
+
* directly usable either.
|
|
8
|
+
*
|
|
9
|
+
* These conversions are opt-in rather than default because each one trades
|
|
10
|
+
* something away, and a database library that quietly changes what `rows`
|
|
11
|
+
* contains is not one to trust. See {@link TypeOptions} for what each costs.
|
|
12
|
+
*/
|
|
13
|
+
import type { FieldInfo, QueryParams, QueryResult, RowMode } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Convert one incoming column value.
|
|
16
|
+
*
|
|
17
|
+
* Called once per cell of a column it is registered for, never for `null` —
|
|
18
|
+
* see {@link TypeOptions.parsers}. `field` carries the column's `subType`,
|
|
19
|
+
* `scale` and `length`, which is what separates a `NUMERIC` from a `BIGINT`
|
|
20
|
+
* or a text BLOB from a binary one when the type code alone does not.
|
|
21
|
+
*/
|
|
22
|
+
export type Parser = (value: unknown, field: FieldInfo) => unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Convert one outgoing parameter to the text Firebird will parse.
|
|
25
|
+
*
|
|
26
|
+
* Return `undefined` to decline, leaving the value to the next serializer and
|
|
27
|
+
* finally to the built-in encoder. Return a string to bind that text, or
|
|
28
|
+
* `null` to bind SQL NULL.
|
|
29
|
+
*/
|
|
30
|
+
export type Serializer = (value: unknown) => string | null | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Which values to convert. Everything defaults to off.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const db = new FirebirdBrowser('mydb', {
|
|
37
|
+
* worker,
|
|
38
|
+
* types: { bigint: true, binary: true },
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export interface TypeOptions {
|
|
43
|
+
/**
|
|
44
|
+
* `BIGINT` as `bigint`.
|
|
45
|
+
*
|
|
46
|
+
* Applies to every `BIGINT`, not only those past 2⁵³. The default rule —
|
|
47
|
+
* `number` when it fits, `string` when it does not — means `typeof row.ID`
|
|
48
|
+
* depends on how large the id happens to be, which is worse than either type
|
|
49
|
+
* on its own.
|
|
50
|
+
*
|
|
51
|
+
* Does **not** apply to `NUMERIC`/`DECIMAL`, which Firebird also stores as a
|
|
52
|
+
* scaled 64-bit integer: those keep their exact decimal string, because a
|
|
53
|
+
* `bigint` would silently drop the scale.
|
|
54
|
+
*/
|
|
55
|
+
bigint?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* `DATE` and `TIMESTAMP` as `Date`.
|
|
58
|
+
*
|
|
59
|
+
* Two costs, both unavoidable rather than incidental:
|
|
60
|
+
*
|
|
61
|
+
* - **Precision.** Firebird keeps 100 µs; `Date` keeps 1 ms. `11:22:33.4567`
|
|
62
|
+
* becomes `11:22:33.456`. The fourth digit is gone.
|
|
63
|
+
* - **Time zone.** Firebird's `DATE` and `TIMESTAMP` carry no zone — they are
|
|
64
|
+
* wall-clock values — while `Date` is an absolute instant, so a zone has to
|
|
65
|
+
* be chosen. **UTC** is used, so the same stored value yields the same
|
|
66
|
+
* `Date` on every machine. Left to JavaScript's own parsing it would be
|
|
67
|
+
* local for `TIMESTAMP` and UTC for `DATE`, which is both machine-dependent
|
|
68
|
+
* and inconsistent between the two types.
|
|
69
|
+
*
|
|
70
|
+
* `TIME`, `TIME WITH TIME ZONE` and `TIMESTAMP WITH TIME ZONE` are **never**
|
|
71
|
+
* converted: `new Date('11:22:33')` is `Invalid Date`, and `Date` has nowhere
|
|
72
|
+
* to keep a named zone like `Europe/Bucharest`. They stay strings.
|
|
73
|
+
*/
|
|
74
|
+
dates?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Binary `BLOB` as `Uint8Array` rather than base64.
|
|
77
|
+
*
|
|
78
|
+
* The one conversion with no downside: base64 is 33% larger than the bytes it
|
|
79
|
+
* encodes and has to be decoded before use. Text BLOBs are unaffected — the
|
|
80
|
+
* engine already returns those as strings.
|
|
81
|
+
*/
|
|
82
|
+
binary?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Convert incoming values yourself, keyed by Firebird SQL type code.
|
|
85
|
+
*
|
|
86
|
+
* ```ts
|
|
87
|
+
* const SQL_TIMESTAMP = 510;
|
|
88
|
+
* new FirebirdBrowser('mydb', {
|
|
89
|
+
* worker,
|
|
90
|
+
* types: { parsers: { [SQL_TIMESTAMP]: (v) => Temporal.PlainDateTime.from(v as string) } },
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* The code is the one {@link FieldInfo.type} reports — `firebirdTypeName()`
|
|
95
|
+
* names them, and they are listed in `field-types.ts`.
|
|
96
|
+
*
|
|
97
|
+
* A parser **replaces** the built-in conversion for its type rather than
|
|
98
|
+
* running alongside it, so `parsers` is also how `bigint` or `dates` gets
|
|
99
|
+
* overridden. Two conversions for one column would otherwise need an order,
|
|
100
|
+
* and no order is obviously right.
|
|
101
|
+
*
|
|
102
|
+
* **Never called for `null`.** A parser that had to guard every value would
|
|
103
|
+
* be all guard, and the alternative — every parser crashing on the first
|
|
104
|
+
* nullable column — is worse. A column's nulls stay null.
|
|
105
|
+
*
|
|
106
|
+
* The type code alone does not always identify a type: `NUMERIC` and
|
|
107
|
+
* `BIGINT` share `SQL_INT64` (580) and differ by `scale`, and BLOBs differ
|
|
108
|
+
* by `subType`. Both reach the parser on `field`, so a parser registered for
|
|
109
|
+
* a shared code has to check — the built-in conversions do exactly that.
|
|
110
|
+
*
|
|
111
|
+
* A code may be registered with or without the nullable flag in its low bit
|
|
112
|
+
* — `580` and `581` name the same type, and both are published. Registering
|
|
113
|
+
* *both* throws, because one of them could only ever be dead.
|
|
114
|
+
*
|
|
115
|
+
* A parser that throws is not caught: the query rejects, since returning
|
|
116
|
+
* half-converted rows would be worse. The error names the column, the type
|
|
117
|
+
* code and the offending value, and keeps the original as its `cause`.
|
|
118
|
+
*/
|
|
119
|
+
parsers?: Record<number, Parser>;
|
|
120
|
+
/**
|
|
121
|
+
* Convert outgoing parameters yourself.
|
|
122
|
+
*
|
|
123
|
+
* ```ts
|
|
124
|
+
* new FirebirdBrowser('mydb', {
|
|
125
|
+
* worker,
|
|
126
|
+
* types: { serializers: [(v) => (v instanceof Decimal ? v.toFixed() : undefined)] },
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* A list rather than a map keyed by type, because there is no type to key
|
|
131
|
+
* on: parameters carry no declared type on the way out. Every value crosses
|
|
132
|
+
* as text and Firebird converts it to whatever the column actually is, which
|
|
133
|
+
* is what lets one path serve integers, dates and strings alike. So a
|
|
134
|
+
* serializer is selected by looking at the *value*, and each one declines by
|
|
135
|
+
* returning `undefined`.
|
|
136
|
+
*
|
|
137
|
+
* Consulted **before** the built-in encoder, so these also override how a
|
|
138
|
+
* `Date` or a `number` is rendered. Like {@link TypeOptions.parsers}, they
|
|
139
|
+
* are never called for `null` or `undefined`, both of which are already SQL
|
|
140
|
+
* NULL.
|
|
141
|
+
*/
|
|
142
|
+
serializers?: Serializer[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* True if any incoming conversion is switched on.
|
|
146
|
+
*
|
|
147
|
+
* Serializers are deliberately not counted: they apply to parameters going
|
|
148
|
+
* out, and this gates {@link applyTypes}, which only ever looks at rows
|
|
149
|
+
* coming back.
|
|
150
|
+
*/
|
|
151
|
+
export declare function hasTypeOptions(options: TypeOptions | undefined): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Apply {@link TypeOptions} to a result set, in place.
|
|
154
|
+
*
|
|
155
|
+
* Returns the same object. Columns needing no conversion are never visited, so
|
|
156
|
+
* a result set with nothing convertible costs one pass over the field list and
|
|
157
|
+
* nothing per row.
|
|
158
|
+
*/
|
|
159
|
+
export declare function applyTypes<T>(result: QueryResult<T>, options: TypeOptions | undefined, rowMode?: RowMode): QueryResult<T>;
|
|
160
|
+
/**
|
|
161
|
+
* Run {@link TypeOptions.serializers} over a parameter list.
|
|
162
|
+
*
|
|
163
|
+
* Returns a new array — the caller's is not theirs to modify — or the original
|
|
164
|
+
* when there is nothing to do, so the common case allocates nothing.
|
|
165
|
+
*
|
|
166
|
+
* This has to happen here rather than in the parameter encoder, for the same
|
|
167
|
+
* reason {@link applyTypes} does: with a Worker transport the encoder runs on
|
|
168
|
+
* the other side of `postMessage`, and a function cannot be structured-cloned.
|
|
169
|
+
* Serializing before the values cross means the Worker only ever receives
|
|
170
|
+
* strings, which clone fine.
|
|
171
|
+
*/
|
|
172
|
+
export declare function applySerializers(params: QueryParams, serializers: Serializer[] | undefined): QueryParams;
|
|
173
|
+
//# sourceMappingURL=value-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-types.d.ts","sourceRoot":"","sources":["../../src/browser/value-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAO,OAAO,EAAE,MAAM,UAAU,CAAC;AAWlF;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAQxE;AAqHD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EACtB,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,OAAO,GAAE,OAAkB,GAC1B,WAAW,CAAC,CAAC,CAAC,CAoDhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,UAAU,EAAE,GAAG,SAAS,GACpC,WAAW,CAgBb"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* value-types.ts – opt-in conversion of result values to richer JavaScript types.
|
|
4
|
+
*
|
|
5
|
+
* The wire format hands back values that are always *correct* and sometimes
|
|
6
|
+
* awkward: a `BIGINT` past 2⁵³ is an exact decimal string, a binary `BLOB` is
|
|
7
|
+
* base64, a `TIMESTAMP` is ISO-8601 text. Nothing is lost, but nothing is
|
|
8
|
+
* directly usable either.
|
|
9
|
+
*
|
|
10
|
+
* These conversions are opt-in rather than default because each one trades
|
|
11
|
+
* something away, and a database library that quietly changes what `rows`
|
|
12
|
+
* contains is not one to trust. See {@link TypeOptions} for what each costs.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.hasTypeOptions = hasTypeOptions;
|
|
16
|
+
exports.applyTypes = applyTypes;
|
|
17
|
+
exports.applySerializers = applySerializers;
|
|
18
|
+
// Firebird type codes, from firebird/impl/sqlda_pub.h.
|
|
19
|
+
const SQL_TIMESTAMP = 510;
|
|
20
|
+
const SQL_BLOB = 520;
|
|
21
|
+
const SQL_TYPE_DATE = 570;
|
|
22
|
+
const SQL_INT64 = 580;
|
|
23
|
+
/** Binary BLOBs are sub-type 0; 1 is text, and the engine already decodes it. */
|
|
24
|
+
const BLOB_SUBTYPE_BINARY = 0;
|
|
25
|
+
/**
|
|
26
|
+
* True if any incoming conversion is switched on.
|
|
27
|
+
*
|
|
28
|
+
* Serializers are deliberately not counted: they apply to parameters going
|
|
29
|
+
* out, and this gates {@link applyTypes}, which only ever looks at rows
|
|
30
|
+
* coming back.
|
|
31
|
+
*/
|
|
32
|
+
function hasTypeOptions(options) {
|
|
33
|
+
return Boolean(options &&
|
|
34
|
+
(options.bigint ||
|
|
35
|
+
options.dates ||
|
|
36
|
+
options.binary ||
|
|
37
|
+
(options.parsers && Object.keys(options.parsers).length > 0)));
|
|
38
|
+
}
|
|
39
|
+
/** Decode base64 to bytes, in either a browser or Node. */
|
|
40
|
+
function base64ToBytes(value) {
|
|
41
|
+
const binary = atob(value);
|
|
42
|
+
const bytes = new Uint8Array(binary.length);
|
|
43
|
+
for (let i = 0; i < binary.length; i++) {
|
|
44
|
+
bytes[i] = binary.charCodeAt(i);
|
|
45
|
+
}
|
|
46
|
+
return bytes;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Index {@link TypeOptions.parsers} by type code with the nullable flag cleared.
|
|
50
|
+
*
|
|
51
|
+
* The flag is the low bit. The engine reports it clear — Firebird ORs it in
|
|
52
|
+
* only when filling a legacy XSQLDA — but the codes are published both ways,
|
|
53
|
+
* and a parser registered as `{ 581: fn }` for a nullable `BIGINT` would
|
|
54
|
+
* otherwise never fire: no conversion, no error, and a column that silently
|
|
55
|
+
* keeps its raw form. Normalising the *registration* keys is what makes that
|
|
56
|
+
* work; masking the lookup alone cannot, because the engine's code is already
|
|
57
|
+
* even.
|
|
58
|
+
*
|
|
59
|
+
* @throws if two keys normalise to the same code, which means one of them is
|
|
60
|
+
* silently unreachable.
|
|
61
|
+
*/
|
|
62
|
+
function normaliseParsers(parsers) {
|
|
63
|
+
if (!parsers)
|
|
64
|
+
return null;
|
|
65
|
+
const byType = new Map();
|
|
66
|
+
for (const [key, parser] of Object.entries(parsers)) {
|
|
67
|
+
const code = Number(key) & ~1;
|
|
68
|
+
if (byType.has(code)) {
|
|
69
|
+
throw new TypeError(`types.parsers has two entries for SQL type ${code}: ${key} and its ` +
|
|
70
|
+
'counterpart with the nullable bit differing. Keep one — they name ' +
|
|
71
|
+
'the same type');
|
|
72
|
+
}
|
|
73
|
+
byType.set(code, parser);
|
|
74
|
+
}
|
|
75
|
+
return byType;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A converter for one column, or null when the column needs none.
|
|
79
|
+
*
|
|
80
|
+
* Chosen once per result set from {@link FieldInfo} rather than per value: the
|
|
81
|
+
* type of a column does not vary row to row, and deciding per value would put
|
|
82
|
+
* a branch in the hot path for every cell.
|
|
83
|
+
*/
|
|
84
|
+
function converterFor(field, options, parsers) {
|
|
85
|
+
const type = field.type;
|
|
86
|
+
if (type === undefined)
|
|
87
|
+
return null;
|
|
88
|
+
const parser = parsers?.get(type & ~1);
|
|
89
|
+
if (parser) {
|
|
90
|
+
// Wins over the built-ins below, which is what makes `parsers` the way to
|
|
91
|
+
// override `dates` rather than a second conversion fighting it.
|
|
92
|
+
return (value) => {
|
|
93
|
+
if (value === null || value === undefined)
|
|
94
|
+
return value;
|
|
95
|
+
try {
|
|
96
|
+
return parser(value, field);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
// A parser is application code and can throw on a value it did not
|
|
100
|
+
// expect. Unwrapped, the error names neither the column nor the type
|
|
101
|
+
// code that selected the parser, and the whole query rejects — the
|
|
102
|
+
// rows are gone, so there is nothing to inspect afterwards either.
|
|
103
|
+
const wrapped = new Error(`parser for column ${field.name} (type ${type}) failed on ` +
|
|
104
|
+
`${typeof value === 'string' ? JSON.stringify(value) : String(value)}: ` +
|
|
105
|
+
`${err instanceof Error ? err.message : String(err)}`);
|
|
106
|
+
// Assigned rather than passed as `new Error(msg, { cause })`, which
|
|
107
|
+
// needs lib ES2022 — this project targets ES2020, and bumping the
|
|
108
|
+
// whole compilation for one property is the wrong trade. The original
|
|
109
|
+
// error and its stack are kept either way.
|
|
110
|
+
wrapped.cause = err;
|
|
111
|
+
throw wrapped;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (options.bigint && type === SQL_INT64 && field.scale === 0) {
|
|
116
|
+
// scale 0 is what separates a BIGINT from a NUMERIC stored in the same
|
|
117
|
+
// 64-bit integer. A scaled value converted to bigint would lose its
|
|
118
|
+
// decimal point without saying so.
|
|
119
|
+
return (value) => value === null || value === undefined ? value : BigInt(value);
|
|
120
|
+
}
|
|
121
|
+
if (options.dates && (type === SQL_TIMESTAMP || type === SQL_TYPE_DATE)) {
|
|
122
|
+
return (value) => {
|
|
123
|
+
if (typeof value !== 'string')
|
|
124
|
+
return value;
|
|
125
|
+
// 'Z' makes the interpretation UTC and explicit. Without it a bare
|
|
126
|
+
// date-time is local and a bare date is UTC — see TypeOptions.dates.
|
|
127
|
+
const parsed = new Date(`${value}Z`);
|
|
128
|
+
// A value the engine produced should always parse; if it somehow does
|
|
129
|
+
// not, the string is more useful to a caller than an Invalid Date.
|
|
130
|
+
return Number.isNaN(parsed.getTime()) ? value : parsed;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (options.binary && type === SQL_BLOB && field.subType === BLOB_SUBTYPE_BINARY) {
|
|
134
|
+
return (value) => (typeof value === 'string' ? base64ToBytes(value) : value);
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Apply {@link TypeOptions} to a result set, in place.
|
|
140
|
+
*
|
|
141
|
+
* Returns the same object. Columns needing no conversion are never visited, so
|
|
142
|
+
* a result set with nothing convertible costs one pass over the field list and
|
|
143
|
+
* nothing per row.
|
|
144
|
+
*/
|
|
145
|
+
function applyTypes(result, options, rowMode = 'object') {
|
|
146
|
+
if (!hasTypeOptions(options) || result.rows.length === 0) {
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
const parsers = normaliseParsers(options.parsers);
|
|
150
|
+
if (rowMode === 'array') {
|
|
151
|
+
// Positional rows need positional converters, and get the simpler job of
|
|
152
|
+
// the two: one converter per column, with no names to collide, so the
|
|
153
|
+
// shadowing rule below does not arise.
|
|
154
|
+
const byIndex = result.fields.map((field) => converterFor(field, options, parsers));
|
|
155
|
+
if (byIndex.every((convert) => convert === null))
|
|
156
|
+
return result;
|
|
157
|
+
for (const row of result.rows) {
|
|
158
|
+
const target = row;
|
|
159
|
+
for (let i = 0; i < byIndex.length; i++) {
|
|
160
|
+
const convert = byIndex[i];
|
|
161
|
+
if (convert)
|
|
162
|
+
target[i] = convert(target[i]);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
167
|
+
// Keyed by column name rather than accumulated per field, because a result
|
|
168
|
+
// set can name two columns the same — `SELECT a.ID, b.ID` — while a row
|
|
169
|
+
// holds one `ID`. Both row builders keep the *last* such column, so the
|
|
170
|
+
// last converter is the one that matches the value actually there; a Map
|
|
171
|
+
// gives exactly that, and running two converters over one cell would
|
|
172
|
+
// otherwise feed the second the first's output.
|
|
173
|
+
const converters = new Map();
|
|
174
|
+
for (const field of result.fields) {
|
|
175
|
+
const convert = converterFor(field, options, parsers);
|
|
176
|
+
if (convert)
|
|
177
|
+
converters.set(field.name, convert);
|
|
178
|
+
// A column with no conversion still shadows an earlier one of the same
|
|
179
|
+
// name, whose converter would otherwise run on this column's value.
|
|
180
|
+
else
|
|
181
|
+
converters.delete(field.name);
|
|
182
|
+
}
|
|
183
|
+
if (converters.size === 0)
|
|
184
|
+
return result;
|
|
185
|
+
for (const row of result.rows) {
|
|
186
|
+
const target = row;
|
|
187
|
+
for (const [name, convert] of converters) {
|
|
188
|
+
target[name] = convert(target[name]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Run {@link TypeOptions.serializers} over a parameter list.
|
|
195
|
+
*
|
|
196
|
+
* Returns a new array — the caller's is not theirs to modify — or the original
|
|
197
|
+
* when there is nothing to do, so the common case allocates nothing.
|
|
198
|
+
*
|
|
199
|
+
* This has to happen here rather than in the parameter encoder, for the same
|
|
200
|
+
* reason {@link applyTypes} does: with a Worker transport the encoder runs on
|
|
201
|
+
* the other side of `postMessage`, and a function cannot be structured-cloned.
|
|
202
|
+
* Serializing before the values cross means the Worker only ever receives
|
|
203
|
+
* strings, which clone fine.
|
|
204
|
+
*/
|
|
205
|
+
function applySerializers(params, serializers) {
|
|
206
|
+
if (!serializers || serializers.length === 0 || params.length === 0) {
|
|
207
|
+
return params;
|
|
208
|
+
}
|
|
209
|
+
return params.map((value) => {
|
|
210
|
+
// null and undefined are already SQL NULL; a serializer that had to
|
|
211
|
+
// recognise them would be writing the encoder's job out again.
|
|
212
|
+
if (value === null || value === undefined)
|
|
213
|
+
return value;
|
|
214
|
+
for (const serialize of serializers) {
|
|
215
|
+
const serialized = serialize(value);
|
|
216
|
+
if (serialized !== undefined)
|
|
217
|
+
return serialized;
|
|
218
|
+
}
|
|
219
|
+
return value;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=value-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-types.js","sourceRoot":"","sources":["../../src/browser/value-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AA6JH,wCAQC;AA4HD,gCAwDC;AAcD,4CAmBC;AAtXD,uDAAuD;AACvD,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,SAAS,GAAG,GAAG,CAA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
|
|
1
|
-
{"version":3,"file":"worker-entry.d.ts","sourceRoot":"","sources":["../../src/browser/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAA0B,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC/D,gBAAgB,CACd,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,KAAK,IAAI,GACrD,IAAI,CAAC;CACT;
|
|
1
|
+
{"version":3,"file":"worker-entry.d.ts","sourceRoot":"","sources":["../../src/browser/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAA0B,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC/D,gBAAgB,CACd,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,KAAK,IAAI,GACrD,IAAI,CAAC;CACT;AAqCD;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,eAAe,GACzB,IAAI,CAwCN"}
|