colbin 0.0.0-stage → 0.8.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/LICENSE +21 -0
- package/README.md +206 -2
- package/dist/asset.d.ts +11 -0
- package/dist/asset.d.ts.map +1 -0
- package/dist/asset.js +23 -0
- package/dist/asset.js.map +1 -0
- package/dist/colbin.inspect.wasm +0 -0
- package/dist/colbin.wasm +0 -0
- package/dist/core.d.ts +199 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +360 -0
- package/dist/core.js.map +1 -0
- package/dist/errors.d.ts +33 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +32 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/wasm-inline.d.ts +2 -0
- package/dist/generated/wasm-inline.d.ts.map +1 -0
- package/dist/generated/wasm-inline.js +7 -0
- package/dist/generated/wasm-inline.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/inspect.d.ts +11 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +29 -0
- package/dist/inspect.js.map +1 -0
- package/dist/materialize.d.ts +66 -0
- package/dist/materialize.d.ts.map +1 -0
- package/dist/materialize.js +342 -0
- package/dist/materialize.js.map +1 -0
- package/dist/node.d.ts +10 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +24 -0
- package/dist/node.js.map +1 -0
- package/dist/shared.d.ts +5 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +5 -0
- package/dist/shared.js.map +1 -0
- package/package.json +54 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm-inline.js","sourceRoot":"","sources":["../../src/generated/wasm-inline.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,2EAA2E;AAC3E,uCAAuC;AACvC,EAAE;AACF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,UAAU,GACrB,kqvUAAkqvU,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Codec as CodecClass } from './core.ts';
|
|
2
|
+
export * from './shared.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The handle.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { Codec } from 'colbin'
|
|
8
|
+
* const codec = await Codec.open()
|
|
9
|
+
* const rows = codec.unmarshal(bytes)
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare const Codec: import("./core.ts").CodecEntry;
|
|
13
|
+
/** The same name as a type, for `let codec: Codec`. */
|
|
14
|
+
export type Codec = CodecClass;
|
|
15
|
+
export declare const unmarshal: (message: Uint8Array, options?: import("./core.ts").UnmarshalOptions) => Promise<unknown>, columns: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<import("./materialize.ts").ColumnTable | null>, toJSONText: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<string>, marshal: (value: unknown, options?: import("./core.ts").MarshalOptions) => Promise<import("./core.ts").Marshaled>, inspect: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<import("./core.ts").Report>;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAyB,KAAK,IAAI,UAAU,EAAmB,MAAM,WAAW,CAAA;AAEvF,cAAc,aAAa,CAAA;AAO3B;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,gCAAmB,CAAA;AAErC,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAE9B,eAAO,MAAQ,SAAS,6FAAE,OAAO,gIAAE,UAAU,yFAAE,OAAO,4GAAE,OAAO,2GAAuB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// The default entry: the module travels inside the JavaScript.
|
|
2
|
+
//
|
|
3
|
+
// INTERNALS.md §16.1 — inline base64 is the default because it needs no
|
|
4
|
+
// bundler configuration and has no runtime 404 mode. A consumer who would
|
|
5
|
+
// rather ship the `.wasm` as an asset imports `colbin/asset`, and one running
|
|
6
|
+
// on Node resolves the package's `node` condition instead, which reads the
|
|
7
|
+
// file beside itself rather than carrying a third of a megabyte of base64
|
|
8
|
+
// through the parser.
|
|
9
|
+
//
|
|
10
|
+
// The base64 is behind a dynamic `import()`, which is what keeps it out of a
|
|
11
|
+
// bundle that never reaches the default source — a page calling
|
|
12
|
+
// `Codec.open({ wasm: fetch('/colbin.wasm') })` should not pay for a copy of
|
|
13
|
+
// the module it is not using.
|
|
14
|
+
import { codecFor, convenience, Codec as CodecClass } from "./core.js";
|
|
15
|
+
export * from "./shared.js";
|
|
16
|
+
async function inline() {
|
|
17
|
+
const { wasmBase64 } = await import("./generated/wasm-inline.js");
|
|
18
|
+
return fromBase64(wasmBase64);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The handle.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { Codec } from 'colbin'
|
|
25
|
+
* const codec = await Codec.open()
|
|
26
|
+
* const rows = codec.unmarshal(bytes)
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const Codec = codecFor(inline);
|
|
30
|
+
export const { unmarshal, columns, toJSONText, marshal, inspect } = convenience(Codec);
|
|
31
|
+
function fromBase64(base64) {
|
|
32
|
+
// `Uint8Array.fromBase64` is one native pass where the engine has it; `atob`
|
|
33
|
+
// and a copy is the fallback.
|
|
34
|
+
const native = Uint8Array.fromBase64;
|
|
35
|
+
if (native)
|
|
36
|
+
return native(base64);
|
|
37
|
+
const binary = atob(base64);
|
|
38
|
+
const bytes = new Uint8Array(binary.length);
|
|
39
|
+
for (let i = 0; i < binary.length; i++)
|
|
40
|
+
bytes[i] = binary.charCod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AE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACvE,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Codec as CodecClass } from './core.ts';
|
|
2
|
+
export * from './shared.ts';
|
|
3
|
+
/** Where the inspect-capable module is, as the bundler resolved it. */
|
|
4
|
+
export declare const wasmURL: URL;
|
|
5
|
+
/** The handle, over a module that has `inspect`. Otherwise identical to the
|
|
6
|
+
* one every other entry exports. */
|
|
7
|
+
export declare const Codec: import("./core.ts").CodecEntry;
|
|
8
|
+
/** The same name as a type, for `let codec: Codec`. */
|
|
9
|
+
export type Codec = CodecClass;
|
|
10
|
+
export declare const unmarshal: (message: Uint8Array, options?: import("./core.ts").UnmarshalOptions) => Promise<unknown>, columns: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<import("./materialize.ts").ColumnTable | null>, toJSONText: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<string>, marshal: (value: unknown, options?: import("./core.ts").MarshalOptions) => Promise<import("./core.ts").Marshaled>, inspect: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<import("./core.ts").Report>;
|
|
11
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAyB,KAAK,IAAI,UAAU,EAAmB,MAAM,WAAW,CAAA;AAEvF,cAAc,aAAa,CAAA;AAE3B,uEAAuE;AACvE,eAAO,MAAM,OAAO,KAAoD,CAAA;AAMxE;oCACoC;AACpC,eAAO,MAAM,KAAK,gCAAoB,CAAA;AAEtC,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAE9B,eAAO,MAAQ,SAAS,6FAAE,OAAO,gIAAE,UAAU,yFAAE,OAAO,4GAAE,OAAO,2GAAuB,CAAA"}
|
package/dist/inspect.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// `colbin/inspect` — the module built with the field-tree walk in it.
|
|
2
|
+
//
|
|
3
|
+
// A second `.wasm`, not a second copy of the wrapper: `codec.inspect()` is the
|
|
4
|
+
// only thing that needs it, and it is 15 KB of code (6.6% of the module) that
|
|
5
|
+
// nothing else calls. Every other entry ships the build without it, so a
|
|
6
|
+
// consumer who only reads messages does not download a span walk to never run
|
|
7
|
+
// — and a consumer who *is* writing a tool that draws the bytes gets it from
|
|
8
|
+
// npm rather than having to build Rust.
|
|
9
|
+
//
|
|
10
|
+
// | | raw | gzipped |
|
|
11
|
+
// |---|---:|---:|
|
|
12
|
+
// | `colbin` / `colbin/asset` | 209 109 B | 84 190 B |
|
|
13
|
+
// | `colbin/inspect` | 224 199 B | 90 114 B |
|
|
14
|
+
//
|
|
15
|
+
// Resolved as an asset, like `colbin/asset` and for the same reasons — a tool
|
|
16
|
+
// that wants the field tree is a tool, and 90 KB inline in its bundle is not
|
|
17
|
+
// what it wants.
|
|
18
|
+
import { codecFor, convenience, Codec as CodecClass } from "./core.js";
|
|
19
|
+
export * from "./shared.js";
|
|
20
|
+
/** Where the inspect-capable module is, as the bundler resolved it. */
|
|
21
|
+
export const wasmURL = new URL('./colbin.inspect.wasm', import.meta.url);
|
|
22
|
+
function fetched() {
|
|
23
|
+
return fetch(wasmURL);
|
|
24
|
+
}
|
|
25
|
+
/** The handle, over a module that has `inspect`. Otherwise identical to the
|
|
26
|
+
* one every other entry exports. */
|
|
27
|
+
export const Codec = codecFor(fetched);
|
|
28
|
+
export const { unmarshal, columns, toJSONText, marshal, inspect } = convenience(Codec);
|
|
29
|
+
//# sourceMappingURL=inspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,wCAAwC;AACxC,EAAE;AACF,sBAAsB;AACtB,kBAAkB;AAClB,uDAAuD;AACvD,8CAA8C;AAC9C,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,iBAAiB;AAEjB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,UAAU,EAAmB,MAAM,WAAW,CAAA;AAEvF,cAAc,aAAa,CAAA;AAE3B,uEAAuE;AACvE,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAExE,SAAS,OAAO;IACd,OAAO,KAAK,CAAC,OAAO,CAAC,CAAA;AACvB,CAAC;AAED;oCACoC;AACpC,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;AAKtC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type ReadRowsOptions = {
|
|
2
|
+
/** Forces the CSP fallback path (or forces it off) regardless of what this
|
|
3
|
+
* page's own CSP allows — for testing the fallback without one. */
|
|
4
|
+
allowGenerated?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The materialize buffer to row objects.
|
|
8
|
+
*
|
|
9
|
+
* `buffer` should be a copy the caller owns outright (not a live view into
|
|
10
|
+
* wasm memory) — this constructs several typed-array views over it at
|
|
11
|
+
* differing offsets, and a later `alloc()` growing the module's memory would
|
|
12
|
+
* detach every one of them.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readRows(buffer: ArrayBuffer, options?: ReadRowsOptions): unknown[];
|
|
15
|
+
/** What a column's values arrive as. */
|
|
16
|
+
export type Column =
|
|
17
|
+
/** One value per row, unpacked from the bitmap the buffer carries. */
|
|
18
|
+
{
|
|
19
|
+
name: string;
|
|
20
|
+
kind: 'bool';
|
|
21
|
+
length: number;
|
|
22
|
+
values: boolean[];
|
|
23
|
+
}
|
|
24
|
+
/** Every value fits a `Number` exactly — the column's own range says so. */
|
|
25
|
+
| {
|
|
26
|
+
name: string;
|
|
27
|
+
kind: 'int';
|
|
28
|
+
length: number;
|
|
29
|
+
values: Float64Array;
|
|
30
|
+
}
|
|
31
|
+
/** Some value is past 2^53, so the column is carried whole rather than
|
|
32
|
+
* rounded. A view over the buffer's own bytes. */
|
|
33
|
+
| {
|
|
34
|
+
name: string;
|
|
35
|
+
kind: 'bigint';
|
|
36
|
+
length: number;
|
|
37
|
+
values: BigInt64Array | BigUint64Array;
|
|
38
|
+
}
|
|
39
|
+
/** A view over the buffer's own bytes. */
|
|
40
|
+
| {
|
|
41
|
+
name: string;
|
|
42
|
+
kind: 'float';
|
|
43
|
+
length: number;
|
|
44
|
+
values: Float64Array;
|
|
45
|
+
} | {
|
|
46
|
+
name: string;
|
|
47
|
+
kind: 'string';
|
|
48
|
+
length: number;
|
|
49
|
+
values: string[];
|
|
50
|
+
};
|
|
51
|
+
export type ColumnTable = {
|
|
52
|
+
rowCount: number;
|
|
53
|
+
columns: Column[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* The materialize buffer as columns rather than rows — INTERNALS.md §16.2, for
|
|
57
|
+
* a caller feeding a grid or a chart that never wants row objects.
|
|
58
|
+
*
|
|
59
|
+
* `float` and `bigint` columns are views straight over `buffer`; the rest are
|
|
60
|
+
* built, because a bitmap, a UTF-8 blob and a pair of i32 lanes are not things
|
|
61
|
+
* a chart can read. Building them is cheap — thousandths of a
|
|
62
|
+
* millisecond per thousand rows — and it is still less work than the row build
|
|
63
|
+
* this exists to skip.
|
|
64
|
+
*/
|
|
65
|
+
export declare function readColumns(buffer: ArrayBuffer): ColumnTable;
|
|
66
|
+
//# sourceMappingURL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;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAiC5D"}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
// Reads the flat buffer `colbin::materialize::to_buffer` writes and turns it
|
|
2
|
+
// into row objects without going through JSON text — INTERNALS.md §16.3.
|
|
3
|
+
//
|
|
4
|
+
// The buffer has no offset table: every run's byte length is derivable from
|
|
5
|
+
// `rowCount` and the field's own kind, so this walks it once, in field order,
|
|
6
|
+
// the same way the Rust writer laid it out. See `rust/src/materialize.rs`'s
|
|
7
|
+
// module doc for the exact layout.
|
|
8
|
+
const KIND_BOOL = 0;
|
|
9
|
+
const KIND_INT = 1;
|
|
10
|
+
const KIND_FLOAT = 2;
|
|
11
|
+
const KIND_STRING = 3;
|
|
12
|
+
const FLAG_SIGNED = 1 << 0;
|
|
13
|
+
const FLAG_EXCEEDS_SAFE_INT = 1 << 1;
|
|
14
|
+
const FLAG_ASCII = 1 << 2;
|
|
15
|
+
function classify(kind, flags) {
|
|
16
|
+
if (kind === KIND_BOOL)
|
|
17
|
+
return 'bool';
|
|
18
|
+
if (kind === KIND_INT) {
|
|
19
|
+
if ((flags & FLAG_EXCEEDS_SAFE_INT) === 0)
|
|
20
|
+
return 'intSafe';
|
|
21
|
+
return (flags & FLAG_SIGNED) !== 0 ? 'intBigSigned' : 'intBigUnsigned';
|
|
22
|
+
}
|
|
23
|
+
if (kind === KIND_FLOAT)
|
|
24
|
+
return 'float';
|
|
25
|
+
return (flags & FLAG_ASCII) !== 0 ? 'stringAscii' : 'stringUtf8';
|
|
26
|
+
}
|
|
27
|
+
function pad8(at) {
|
|
28
|
+
return Math.ceil(at / 8) * 8;
|
|
29
|
+
}
|
|
30
|
+
/** Reads every field's run at the current cursor, in header order. */
|
|
31
|
+
function readRuns(buffer, start, rowCount, fields) {
|
|
32
|
+
const runs = [];
|
|
33
|
+
let at = start;
|
|
34
|
+
for (const field of fields) {
|
|
35
|
+
switch (field.col) {
|
|
36
|
+
case 'bool': {
|
|
37
|
+
const bytes = Math.ceil(rowCount / 8);
|
|
38
|
+
runs.push({ col: 'bool', bitmap: new Uint8Array(buffer, at, bytes) });
|
|
39
|
+
at += bytes;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case 'intSafe': {
|
|
43
|
+
// Low/high Int32 pairs over the same bytes an i64 run holds. `hi` is
|
|
44
|
+
// read signed and `lo` unsigned: that reconstructs any 64-bit two's
|
|
45
|
+
// complement pattern exactly, whichever the field's own signedness,
|
|
46
|
+
// as long as the true value's magnitude is under 2^53 — which the
|
|
47
|
+
// exceeds flag guarantees for this column kind (INTERNALS.md §16.3).
|
|
48
|
+
runs.push({
|
|
49
|
+
col: 'intSafe',
|
|
50
|
+
hi: new Int32Array(buffer, at, rowCount * 2),
|
|
51
|
+
lo: new Uint32Array(buffer, at, rowCount * 2),
|
|
52
|
+
});
|
|
53
|
+
at += rowCount * 8;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case 'intBigSigned': {
|
|
57
|
+
runs.push({ col: 'intBigSigned', view: new BigInt64Array(buffer, at, rowCount) });
|
|
58
|
+
at += rowCount * 8;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case 'intBigUnsigned': {
|
|
62
|
+
runs.push({ col: 'intBigUnsigned', view: new BigUint64Array(buffer, at, rowCount) });
|
|
63
|
+
at += rowCount * 8;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'float': {
|
|
67
|
+
runs.push({ col: 'float', view: new Float64Array(buffer, at, rowCount) });
|
|
68
|
+
at += rowCount * 8;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case 'stringAscii': {
|
|
72
|
+
const offsets = new Uint32Array(buffer, at, rowCount + 1);
|
|
73
|
+
const blobStart = at + (rowCount + 1) * 4;
|
|
74
|
+
const blobLen = offsets[rowCount];
|
|
75
|
+
// One bulk decode over the whole blob, then `substring` per row: 10-12x
|
|
76
|
+
// faster than decoding each string, because byte offsets equal UTF-16
|
|
77
|
+
// code unit offsets exactly when the blob is ASCII.
|
|
78
|
+
const text = new TextDecoder().decode(new Uint8Array(buffer, blobStart, blobLen));
|
|
79
|
+
runs.push({ col: 'stringAscii', text, offsets });
|
|
80
|
+
at = blobStart + blobLen;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case 'stringUtf8': {
|
|
84
|
+
const offsets = new Uint32Array(buffer, at, rowCount + 1);
|
|
85
|
+
const blobStart = at + (rowCount + 1) * 4;
|
|
86
|
+
const blobLen = offsets[rowCount];
|
|
87
|
+
runs.push({
|
|
88
|
+
col: 'stringUtf8',
|
|
89
|
+
blob: new Uint8Array(buffer, blobStart, blobLen),
|
|
90
|
+
offsets,
|
|
91
|
+
});
|
|
92
|
+
at = blobStart + blobLen;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
at = pad8(at);
|
|
97
|
+
}
|
|
98
|
+
return runs;
|
|
99
|
+
}
|
|
100
|
+
/** The flattened argument list the generated builder wants: one or two typed
|
|
101
|
+
* arrays per field, in field order, matching `getFactory`'s parameter list. */
|
|
102
|
+
function argsOf(runs) {
|
|
103
|
+
const args = [];
|
|
104
|
+
for (const run of runs) {
|
|
105
|
+
switch (run.col) {
|
|
106
|
+
case 'bool':
|
|
107
|
+
args.push(run.bitmap);
|
|
108
|
+
break;
|
|
109
|
+
case 'intSafe':
|
|
110
|
+
args.push(run.hi, run.lo);
|
|
111
|
+
break;
|
|
112
|
+
case 'intBigSigned':
|
|
113
|
+
case 'intBigUnsigned':
|
|
114
|
+
case 'float':
|
|
115
|
+
args.push(run.view);
|
|
116
|
+
break;
|
|
117
|
+
case 'stringAscii':
|
|
118
|
+
args.push(run.text, run.offsets);
|
|
119
|
+
break;
|
|
120
|
+
case 'stringUtf8':
|
|
121
|
+
args.push(run.blob, run.offsets);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return args;
|
|
126
|
+
}
|
|
127
|
+
/** A uniform reader per field, for the CSP fallback. */
|
|
128
|
+
function genericOf(runs) {
|
|
129
|
+
return runs.map((run) => {
|
|
130
|
+
switch (run.col) {
|
|
131
|
+
case 'bool':
|
|
132
|
+
return { get: (i) => ((run.bitmap[i >> 3] >> (i & 7)) & 1) === 1 };
|
|
133
|
+
case 'intSafe':
|
|
134
|
+
return { get: (i) => run.hi[2 * i + 1] * 4294967296 + run.lo[2 * i] };
|
|
135
|
+
case 'intBigSigned':
|
|
136
|
+
case 'intBigUnsigned':
|
|
137
|
+
case 'float':
|
|
138
|
+
return { get: (i) => run.view[i] };
|
|
139
|
+
case 'stringAscii':
|
|
140
|
+
return { get: (i) => run.text.substring(run.offsets[i], run.offsets[i + 1]) };
|
|
141
|
+
case 'stringUtf8': {
|
|
142
|
+
const decoder = new TextDecoder();
|
|
143
|
+
return { get: (i) => decoder.decode(run.blob.subarray(run.offsets[i], run.offsets[i + 1])) };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const factoryCache = new Map();
|
|
149
|
+
function signatureOf(fields) {
|
|
150
|
+
return fields.map((f) => `${f.col}:${f.name}`).join('|');
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A generated, monomorphic row builder for this exact field signature,
|
|
154
|
+
* compiled once and cached — measured at 10x a generic `for key in schema`
|
|
155
|
+
* loop, because V8 gives every row the same hidden class.
|
|
156
|
+
*/
|
|
157
|
+
function getFactory(fields) {
|
|
158
|
+
const key = signatureOf(fields);
|
|
159
|
+
const cached = factoryCache.get(key);
|
|
160
|
+
if (cached)
|
|
161
|
+
return cached;
|
|
162
|
+
const params = [];
|
|
163
|
+
const entries = [];
|
|
164
|
+
fields.forEach((field, k) => {
|
|
165
|
+
const prop = JSON.stringify(field.name);
|
|
166
|
+
switch (field.col) {
|
|
167
|
+
case 'bool': {
|
|
168
|
+
const p = `b${k}`;
|
|
169
|
+
params.push(p);
|
|
170
|
+
entries.push(`${prop}:((${p}[i>>3]>>(i&7))&1)===1`);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case 'intSafe': {
|
|
174
|
+
const hi = `h${k}`;
|
|
175
|
+
const lo = `l${k}`;
|
|
176
|
+
params.push(hi, lo);
|
|
177
|
+
entries.push(`${prop}:${hi}[2*i+1]*4294967296+${lo}[2*i]`);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
case 'intBigSigned':
|
|
181
|
+
case 'intBigUnsigned': {
|
|
182
|
+
const p = `v${k}`;
|
|
183
|
+
params.push(p);
|
|
184
|
+
entries.push(`${prop}:${p}[i]`);
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
case 'float': {
|
|
188
|
+
const p = `f${k}`;
|
|
189
|
+
params.push(p);
|
|
190
|
+
entries.push(`${prop}:${p}[i]`);
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
case 'stringAscii': {
|
|
194
|
+
const s = `s${k}`;
|
|
195
|
+
const o = `o${k}`;
|
|
196
|
+
params.push(s, o);
|
|
197
|
+
entries.push(`${prop}:${s}.substring(${o}[i],${o}[i+1])`);
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
case 'stringUtf8': {
|
|
201
|
+
const s = `s${k}`;
|
|
202
|
+
const o = `o${k}`;
|
|
203
|
+
params.push(s, o);
|
|
204
|
+
entries.push(`${prop}:__dec.decode(${s}.subarray(${o}[i],${o}[i+1]))`);
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
const body = `const __dec=new TextDecoder();` +
|
|
210
|
+
`return function(n,${params.join(',')}){` +
|
|
211
|
+
`const out=new Array(n);` +
|
|
212
|
+
`for(let i=0;i<n;i++)out[i]={${entries.join(',')}};` +
|
|
213
|
+
`return out};`;
|
|
214
|
+
// A generated function, not a string eval'd in scope: the only thing built
|
|
215
|
+
// from field data is a property name, quoted through `JSON.stringify`, so
|
|
216
|
+
// there is no injection surface here even though the source is assembled by
|
|
217
|
+
// hand.
|
|
218
|
+
// eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval
|
|
219
|
+
const factory = new Function(body)();
|
|
220
|
+
factoryCache.set(key, factory);
|
|
221
|
+
return factory;
|
|
222
|
+
}
|
|
223
|
+
function buildGeneric(fields, generic, rowCount) {
|
|
224
|
+
const out = new Array(rowCount);
|
|
225
|
+
for (let i = 0; i < rowCount; i++) {
|
|
226
|
+
const row = {};
|
|
227
|
+
for (let k = 0; k < fields.length; k++) {
|
|
228
|
+
row[fields[k].name] = generic[k].get(i);
|
|
229
|
+
}
|
|
230
|
+
out[i] = row;
|
|
231
|
+
}
|
|
232
|
+
return out;
|
|
233
|
+
}
|
|
234
|
+
/** Undefined until the first real probe; `allowGenerated` bypasses the cache
|
|
235
|
+
* entirely, which is what lets a test force the CSP fallback without one. */
|
|
236
|
+
let generatedAllowed;
|
|
237
|
+
function canUseGenerated(force) {
|
|
238
|
+
if (force !== undefined)
|
|
239
|
+
return force;
|
|
240
|
+
if (generatedAllowed === undefined) {
|
|
241
|
+
try {
|
|
242
|
+
// eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval
|
|
243
|
+
new Function('return 1')();
|
|
244
|
+
generatedAllowed = true;
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
generatedAllowed = false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return generatedAllowed;
|
|
251
|
+
}
|
|
252
|
+
/** The buffer's header: how many rows, what the fields are, and where the
|
|
253
|
+
* first run starts. */
|
|
254
|
+
function readHeader(buffer) {
|
|
255
|
+
const view = new DataView(buffer);
|
|
256
|
+
const version = view.getUint32(0, true);
|
|
257
|
+
if (version !== 1) {
|
|
258
|
+
throw new Error(`materialize: unknown buffer version ${version}`);
|
|
259
|
+
}
|
|
260
|
+
const rowCount = view.getUint32(4, true);
|
|
261
|
+
const fieldCount = view.getUint32(8, true);
|
|
262
|
+
const nameDecoder = new TextDecoder();
|
|
263
|
+
let at = 12;
|
|
264
|
+
const fields = [];
|
|
265
|
+
for (let i = 0; i < fieldCount; i++) {
|
|
266
|
+
const kind = view.getUint8(at);
|
|
267
|
+
const flags = view.getUint8(at + 1);
|
|
268
|
+
const nameLen = view.getUint16(at + 2, true);
|
|
269
|
+
const name = nameDecoder.decode(new Uint8Array(buffer, at + 4, nameLen));
|
|
270
|
+
at += 4 + nameLen;
|
|
271
|
+
fields.push({ name, col: classify(kind, flags) });
|
|
272
|
+
}
|
|
273
|
+
return { rowCount, fields, at: pad8(at) };
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* The materialize buffer to row objects.
|
|
277
|
+
*
|
|
278
|
+
* `buffer` should be a copy the caller owns outright (not a live view into
|
|
279
|
+
* wasm memory) — this constructs several typed-array views over it at
|
|
280
|
+
* differing offsets, and a later `alloc()` growing the module's memory would
|
|
281
|
+
* detach every one of them.
|
|
282
|
+
*/
|
|
283
|
+
export function readRows(buffer, options = {}) {
|
|
284
|
+
const { rowCount, fields, at } = readHeader(buffer);
|
|
285
|
+
const runs = readRuns(buffer, at, rowCount, fields);
|
|
286
|
+
if (canUseGenerated(options.allowGenerated)) {
|
|
287
|
+
try {
|
|
288
|
+
return getFactory(fields)(rowCount, ...argsOf(runs));
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
// A signature this engine refused to compile mid-session (a CSP that
|
|
292
|
+
// only some navigations enforce, say) — fall through to the generic path.
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return buildGeneric(fields, genericOf(runs), rowCount);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The materialize buffer as columns rather than rows — INTERNALS.md §16.2, for
|
|
299
|
+
* a caller feeding a grid or a chart that never wants row objects.
|
|
300
|
+
*
|
|
301
|
+
* `float` and `bigint` columns are views straight over `buffer`; the rest are
|
|
302
|
+
* built, because a bitmap, a UTF-8 blob and a pair of i32 lanes are not things
|
|
303
|
+
* a chart can read. Building them is cheap — thousandths of a
|
|
304
|
+
* millisecond per thousand rows — and it is still less work than the row build
|
|
305
|
+
* this exists to skip.
|
|
306
|
+
*/
|
|
307
|
+
export function readColumns(buffer) {
|
|
308
|
+
const { rowCount, fields, at } = readHeader(buffer);
|
|
309
|
+
const runs = readRuns(buffer, at, rowCount, fields);
|
|
310
|
+
const columns = runs.map((run, k) => {
|
|
311
|
+
const name = fields[k].name;
|
|
312
|
+
switch (run.col) {
|
|
313
|
+
case 'bool': {
|
|
314
|
+
const values = new Array(rowCount);
|
|
315
|
+
for (let i = 0; i < rowCount; i++)
|
|
316
|
+
values[i] = ((run.bitmap[i >> 3] >> (i & 7)) & 1) === 1;
|
|
317
|
+
return { name, kind: 'bool', length: rowCount, values };
|
|
318
|
+
}
|
|
319
|
+
case 'intSafe': {
|
|
320
|
+
const values = new Float64Array(rowCount);
|
|
321
|
+
for (let i = 0; i < rowCount; i++)
|
|
322
|
+
values[i] = run.hi[2 * i + 1] * 4294967296 + run.lo[2 * i];
|
|
323
|
+
return { name, kind: 'int', length: rowCount, values };
|
|
324
|
+
}
|
|
325
|
+
case 'intBigSigned':
|
|
326
|
+
case 'intBigUnsigned':
|
|
327
|
+
return { name, kind: 'bigint', length: rowCount, values: run.view };
|
|
328
|
+
case 'float':
|
|
329
|
+
return { name, kind: 'float', length: rowCount, values: run.view };
|
|
330
|
+
case 'stringAscii':
|
|
331
|
+
case 'stringUtf8': {
|
|
332
|
+
const read = genericOf([run])[0];
|
|
333
|
+
const values = new Array(rowCount);
|
|
334
|
+
for (let i = 0; i < rowCount; i++)
|
|
335
|
+
values[i] = read.get(i);
|
|
336
|
+
return { name, kind: 'string', length: rowCount, values };
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
return { rowCount, columns };
|
|
341
|
+
}
|
|
342
|
+
//# sourceMappingURL=materialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialize.js","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,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,CAAA;YACpE,KAAK,aAAa,CAAC;YACnB,KAAK,YAAY,CAAC,CAAC,CAAC;gBAClB,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBAChC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAS,QAAQ,CAAC,CAAA;gBAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE;oBAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAW,CAAA;gBACpE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;YAC3D,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;AAC9B,CAAC"}
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Codec as CodecClass } from './core.ts';
|
|
2
|
+
export * from './shared.ts';
|
|
3
|
+
/** The `.wasm` beside this file: `dist/colbin.wasm` in the tarball. */
|
|
4
|
+
export declare const wasmPath: URL;
|
|
5
|
+
/** The handle. See `colbin`'s README for the shape. */
|
|
6
|
+
export declare const Codec: import("./core.ts").CodecEntry;
|
|
7
|
+
/** The same name as a type, for `let codec: Codec`. */
|
|
8
|
+
export type Codec = CodecClass;
|
|
9
|
+
export declare const unmarshal: (message: Uint8Array, options?: import("./core.ts").UnmarshalOptions) => Promise<unknown>, columns: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<import("./materialize.ts").ColumnTable | null>, toJSONText: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<string>, marshal: (value: unknown, options?: import("./core.ts").MarshalOptions) => Promise<import("./core.ts").Marshaled>, inspect: (message: Uint8Array, options?: import("./core.ts").DecodeOptions) => Promise<import("./core.ts").Report>;
|
|
10
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyB,KAAK,IAAI,UAAU,EAAmB,MAAM,WAAW,CAAA;AAEvF,cAAc,aAAa,CAAA;AAE3B,uEAAuE;AACvE,eAAO,MAAM,QAAQ,KAA4C,CAAA;AAOjE,uDAAuD;AACvD,eAAO,MAAM,KAAK,gCAAqB,CAAA;AAEvC,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAE9B,eAAO,MAAQ,SAAS,6FAAE,OAAO,gIAAE,UAAU,yFAAE,OAAO,4GAAE,OAAO,2GAAuB,CAAA"}
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// The `node` condition of the package's main entry.
|
|
2
|
+
//
|
|
3
|
+
// Node resolves `import 'colbin'` here rather than to `index.ts`, and the only
|
|
4
|
+
// difference is where the module comes from: the `.wasm` ships in the tarball
|
|
5
|
+
// beside this file, so reading it costs one `readFile` and no base64 at all.
|
|
6
|
+
// An inlined third of a megabyte would be parsed by V8 on every process start
|
|
7
|
+
// for nothing.
|
|
8
|
+
//
|
|
9
|
+
// `node:fs` is imported dynamically so that a bundler which resolves the
|
|
10
|
+
// `node` condition for a browser build — some do, by misconfiguration — fails
|
|
11
|
+
// at the point it tries to open a file rather than at import time, and so the
|
|
12
|
+
// import never appears in a bundle that does not call `open()`.
|
|
13
|
+
import { codecFor, convenience, Codec as CodecClass } from "./core.js";
|
|
14
|
+
export * from "./shared.js";
|
|
15
|
+
/** The `.wasm` beside this file: `dist/colbin.wasm` in the tarball. */
|
|
16
|
+
export const wasmPath = new URL('./colbin.wasm', import.meta.url);
|
|
17
|
+
async function fromDisk() {
|
|
18
|
+
const { readFile } = await import('node:fs/promises');
|
|
19
|
+
return readFile(wasmPath);
|
|
20
|
+
}
|
|
21
|
+
/** The handle. See `colbin`'s README for the shape. */
|
|
22
|
+
export const Codec = codecFor(fromDisk);
|
|
23
|
+
export const { unmarshal, columns, toJSONText, marshal, inspect } = convenience(Codec);
|
|
24
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,eAAe;AACf,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,gEAAgE;AAEhE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,UAAU,EAAmB,MAAM,WAAW,CAAA;AAEvF,cAAc,aAAa,CAAA;AAE3B,uEAAuE;AACvE,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEjE,KAAK,UAAU,QAAQ;IACrB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAA;IACrD,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAC3B,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAKvC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA"}
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ColbinError } from './errors.ts';
|
|
2
|
+
export type { Diagnostic } from './errors.ts';
|
|
3
|
+
export type { CodecEntry, Convenience, DecodeOptions, Field, Marshaled, MarshalOptions, OpenOptions, Path, Report, UnmarshalOptions, WasmSource, } from './core.ts';
|
|
4
|
+
export type { Column, ColumnTable, ReadRowsOptions } from './materialize.ts';
|
|
5
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,KAAK,EACL,SAAS,EACT,cAAc,EACd,WAAW,EACX,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,UAAU,GACX,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// What every entry re-exports: the error, and the types. The three entries
|
|
2
|
+
// differ only in where they find the `.wasm`, so everything that is not that
|
|
3
|
+
// lives here and each of them does `export * from './shared.ts'`.
|
|
4
|
+
export { ColbinError } from "./errors.js";
|
|
5
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,kEAAkE;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|