@nika-js/onlymap 0.9.1 → 0.10.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 +18 -0
- package/README.md +26 -2
- package/dist/{basemap-DL0mk9Bf.js → basemap-9lXclX9H.js} +3882 -3980
- package/dist/cartograph/elements/om-frame.d.ts +67 -1
- package/dist/cartograph/georef.d.ts +18 -4
- package/dist/cartograph/schema.d.ts +11 -0
- package/dist/cartograph.js +1480 -1311
- package/dist/cartograph.standalone.js +1808 -1615
- package/dist/{cityjson-D_V5GY8b.js → cityjson-k-z1r6c0.js} +1 -1
- package/dist/{crs-DsDQ4Q4i.js → crs-BzE_KP4M.js} +25 -2
- package/dist/{crs-Ciu7Xs7a.js → crs-ChglCB3O.js} +39 -16
- package/dist/elements/om-map.d.ts +10 -0
- package/dist/{geoparquet-DJxZA0if.js → geoparquet-DFDZDBun.js} +10 -10
- package/dist/globe-view-D9wjfL0T.js +104 -0
- package/dist/hillshade-C2BQr6pd.js +298 -0
- package/dist/{hillshade-shader-n_zManfZ.js → hillshade-shader-DI2uLSNU.js} +15 -10
- package/dist/hillshade-shader.d.ts +18 -2
- package/dist/hillshade.d.ts +30 -0
- package/dist/{ifc-Dc-TdSJr.js → ifc-DXwePQRv.js} +131 -131
- package/dist/{index-CvuDsvnk.js → index-4Tvlt0iO.js} +47 -47
- package/dist/{index-BjcPjICh.js → index-Bn66l3KG.js} +59 -59
- package/dist/index-BuXrMq5D.js +322 -0
- package/dist/index-CNRbZHkK.js +459 -0
- package/dist/{index-DdTZSuAb.js → index-CkovmN47.js} +106 -106
- package/dist/index-CmuOizAF.js +641 -0
- package/dist/index-CvT5QHBS.js +65 -0
- package/dist/{index-vLXZuog4.js → index-DnVHKI61.js} +1 -1
- package/dist/{index-oY3XHIux.js → index-JjyDEqAS.js} +18178 -16943
- package/dist/index.d.ts +4 -0
- package/dist/layer-registry.d.ts +27 -0
- package/dist/{lerc-Bph62dCb.js → lerc-C1mQ_Kqq.js} +1 -1
- package/dist/onlymap.standalone.js +48211 -45574
- package/dist/onlymapjs.js +77 -74
- package/dist/parse-manifest.d.ts +6 -0
- package/dist/plane-camera.d.ts +59 -0
- package/dist/plane-layers.d.ts +56 -0
- package/dist/plane-tiles.d.ts +99 -0
- package/dist/plane-tileset.d.ts +31 -0
- package/dist/plane-warp.d.ts +91 -0
- package/dist/post-process-effect-DfslKPM6.js +197 -0
- package/dist/programmatic.d.ts +16 -1
- package/dist/projection.d.ts +118 -0
- package/dist/{raster-D-eTzCE3.js → raster-D2NzdjZE.js} +4 -4
- package/dist/{raster-pipeline-BlOnMPJe.js → raster-pipeline-qnD1icOv.js} +4 -3
- package/dist/runtime-core.d.ts +140 -1
- package/dist/serialize/clip.d.ts +50 -0
- package/dist/serialize/declutter.d.ts +44 -0
- package/dist/serialize/emit.d.ts +60 -0
- package/dist/serialize/index.d.ts +64 -0
- package/dist/serialize/strategy.d.ts +30 -0
- package/dist/serialize/style.d.ts +77 -0
- package/dist/snapshot.d.ts +46 -0
- package/dist/surface-anchor.d.ts +6 -0
- package/dist/text-on-path-Dm7vtNqt.js +146 -0
- package/dist/text-on-path.d.ts +157 -0
- package/dist/transform/buffer.d.ts +63 -0
- package/dist/transform/contour.d.ts +37 -0
- package/dist/transform/dot-density.d.ts +19 -0
- package/dist/transform/field.d.ts +80 -0
- package/dist/transform/geometry.d.ts +20 -0
- package/dist/transform/index.d.ts +29 -0
- package/dist/transform/simplify.d.ts +10 -0
- package/dist/transform/smooth.d.ts +12 -0
- package/dist/transform-stage.d.ts +92 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-BGDoEtFb.js → zarr-D5e5agMG.js} +2 -2
- package/docs/cartograph.md +12 -4
- package/docs/cartography.md +328 -0
- package/docs/design/arrows.md +182 -0
- package/docs/design/carto-substrate.md +1055 -0
- package/docs/design/extensions.md +250 -0
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +18 -0
- package/onlymapjs.html-data.json +169 -19
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +6 -2
- package/skills/onlymapjs/references/syntax.md +22 -2
- package/dist/hillshade-DR3TxO1a.js +0 -186
- package/dist/index-DO_w0tqR.js +0 -514
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { aM as R, aN as S, aO as E, aP as N, aQ as h, aR as w, aS as W, aT as O, aU as x, aV as I, aW as B, aX as _, aY as P, aZ as k, a_ as $, a$ as z, b0 as C, b1 as F, b2 as v, b3 as M, b4 as p, b5 as U } from "./index-JjyDEqAS.js";
|
|
2
|
+
import { b6 as $e, b7 as ze, b8 as Ce, b9 as ve, ba as Me, bb as Ue, bc as je, bd as De, be as qe, bf as Je, bg as Ve, bh as Ge, bi as He, bj as Qe, bk as Xe, bl as Ye, bm as Ze, bn as Ke, bo as et, bp as tt, bq as nt, br as rt, bs as at, bt as st, bu as ot } from "./index-JjyDEqAS.js";
|
|
3
3
|
import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
|
|
4
|
-
async function
|
|
4
|
+
async function q(t, e, n = {}, r = {}) {
|
|
5
5
|
const a = R(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
|
|
6
6
|
o || (c.url = E(t, n));
|
|
7
7
|
const i = s.getWorkerPool(c), u = n.jobName || t.name, d = await i.startJob(
|
|
8
8
|
u,
|
|
9
9
|
// eslint-disable-next-line
|
|
10
|
-
|
|
10
|
+
J.bind(null, r)
|
|
11
11
|
), y = N(n);
|
|
12
12
|
return d.postMessage("process", { input: e, options: y }), (await d.result).result;
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
14
|
+
async function J(t, e, n, r) {
|
|
15
15
|
switch (n) {
|
|
16
16
|
case "done":
|
|
17
17
|
e.done(r);
|
|
@@ -66,12 +66,12 @@ async function* pe(t) {
|
|
|
66
66
|
}
|
|
67
67
|
e.length > 0 && (yield e);
|
|
68
68
|
}
|
|
69
|
-
async function*
|
|
69
|
+
async function* be(t) {
|
|
70
70
|
let e = 1;
|
|
71
71
|
for await (const n of t)
|
|
72
72
|
yield { counter: e, line: n }, e++;
|
|
73
73
|
}
|
|
74
|
-
const G = "4.4.3",
|
|
74
|
+
const G = "4.4.3", ge = {
|
|
75
75
|
dataType: null,
|
|
76
76
|
batchType: null,
|
|
77
77
|
name: "JSON",
|
|
@@ -82,11 +82,11 @@ const G = "4.4.3", Te = {
|
|
|
82
82
|
mimeTypes: ["application/json"],
|
|
83
83
|
category: "json",
|
|
84
84
|
text: !0,
|
|
85
|
-
parseTextSync:
|
|
86
|
-
parse: async (t) =>
|
|
85
|
+
parseTextSync: b,
|
|
86
|
+
parse: async (t) => b(new TextDecoder().decode(t)),
|
|
87
87
|
options: {}
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function b(t) {
|
|
90
90
|
return JSON.parse(t);
|
|
91
91
|
}
|
|
92
92
|
class H {
|
|
@@ -111,7 +111,7 @@ class H {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
const f = new Error("Not implemented");
|
|
114
|
-
class
|
|
114
|
+
class Q {
|
|
115
115
|
handle;
|
|
116
116
|
size = 0;
|
|
117
117
|
bigsize = 0n;
|
|
@@ -145,12 +145,12 @@ class K {
|
|
|
145
145
|
async close() {
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
async function
|
|
148
|
+
async function Te(t, e, n) {
|
|
149
149
|
t instanceof Blob || (t = new Blob([t]));
|
|
150
150
|
const r = t.slice(e, e + n);
|
|
151
|
-
return await
|
|
151
|
+
return await X(r);
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function X(t) {
|
|
154
154
|
return await new Promise((e, n) => {
|
|
155
155
|
const r = new FileReader();
|
|
156
156
|
r.onload = (a) => e(a?.target?.result), r.onerror = (a) => n(a), r.readAsArrayBuffer(t);
|
|
@@ -164,16 +164,16 @@ function Se(t, e, n, r) {
|
|
|
164
164
|
const c = x(n, o, s), i = I(t), u = () => {
|
|
165
165
|
throw new Error("parseSync called parse (which is async");
|
|
166
166
|
};
|
|
167
|
-
return r = B({ url: i, _parseSync: u, _parse: u, loaders: e }, c, r || null),
|
|
167
|
+
return r = B({ url: i, _parseSync: u, _parse: u, loaders: e }, c, r || null), Y(o, t, c, r);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Y(t, e, n, r) {
|
|
170
170
|
if (e = _(e, t), t.parseTextSync && typeof e == "string")
|
|
171
171
|
return t.parseTextSync(e, n);
|
|
172
172
|
if (t.parseSync && e instanceof ArrayBuffer)
|
|
173
173
|
return t.parseSync(e, n, r);
|
|
174
174
|
throw new Error(`${t.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${r.url || ""}`);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Z(t) {
|
|
177
177
|
return { ...t, length: j(t), batchType: "data" };
|
|
178
178
|
}
|
|
179
179
|
async function l(t, e, n, r) {
|
|
@@ -183,9 +183,9 @@ async function l(t, e, n, r) {
|
|
|
183
183
|
if (!o)
|
|
184
184
|
return [];
|
|
185
185
|
const c = x(n, o, a, s);
|
|
186
|
-
return r = B({ url: s, _parseInBatches: l, _parse: k, loaders: a }, c, r || null), await
|
|
186
|
+
return r = B({ url: s, _parseInBatches: l, _parse: k, loaders: a }, c, r || null), await K(o, t, c, r);
|
|
187
187
|
}
|
|
188
|
-
async function
|
|
188
|
+
async function K(t, e, n, r) {
|
|
189
189
|
const a = await ee(t, e, n, r);
|
|
190
190
|
if (!n?.core?.metadata)
|
|
191
191
|
return a;
|
|
@@ -220,7 +220,7 @@ async function* te(t, e, n, r) {
|
|
|
220
220
|
yield ne(s, e);
|
|
221
221
|
}
|
|
222
222
|
function ne(t, e) {
|
|
223
|
-
const n = D(t) ?
|
|
223
|
+
const n = D(t) ? Z(t) : {
|
|
224
224
|
shape: "unknown",
|
|
225
225
|
batchType: "data",
|
|
226
226
|
data: t,
|
|
@@ -237,10 +237,10 @@ async function re(t, e = []) {
|
|
|
237
237
|
function xe(t, e, n, r) {
|
|
238
238
|
let a;
|
|
239
239
|
!Array.isArray(e) && !w(e) ? (n = e, a = void 0) : a = e;
|
|
240
|
-
const s =
|
|
241
|
-
return Array.isArray(t) ? t.map((c) =>
|
|
240
|
+
const s = C(n || {});
|
|
241
|
+
return Array.isArray(t) ? t.map((c) => g(c, a, n || {}, s)) : g(t, a, n || {}, s);
|
|
242
242
|
}
|
|
243
|
-
async function
|
|
243
|
+
async function g(t, e, n, r) {
|
|
244
244
|
if (typeof t == "string") {
|
|
245
245
|
const s = await r(t);
|
|
246
246
|
return Array.isArray(e) ? await l(s, e, n) : await l(s, e, n);
|
|
@@ -258,7 +258,7 @@ async function ae(t, e, n) {
|
|
|
258
258
|
const r = se(t, e, n), a = [];
|
|
259
259
|
for await (const s of r)
|
|
260
260
|
a.push(s);
|
|
261
|
-
return
|
|
261
|
+
return v(...a);
|
|
262
262
|
}
|
|
263
263
|
throw new Error("Writer could not encode data");
|
|
264
264
|
}
|
|
@@ -282,8 +282,8 @@ function oe(t) {
|
|
|
282
282
|
return [{ ...t, start: 0, end: t.length }];
|
|
283
283
|
}
|
|
284
284
|
async function Be(t, e, n) {
|
|
285
|
-
const a = { ...
|
|
286
|
-
return e.encodeURLtoURL ? ue(e, t, a) : V(e, a) ? await
|
|
285
|
+
const a = { ...M(), ...n };
|
|
286
|
+
return e.encodeURLtoURL ? ue(e, t, a) : V(e, a) ? await q(e, t, a) : await e.encode(t, a);
|
|
287
287
|
}
|
|
288
288
|
function ce(t, e, n) {
|
|
289
289
|
if (e.encodeSync)
|
|
@@ -327,15 +327,15 @@ async function ie(t, e, n, r) {
|
|
|
327
327
|
async function ue(t, e, n) {
|
|
328
328
|
if (h)
|
|
329
329
|
throw new Error(`Writer ${t.name} not supported in browser`);
|
|
330
|
-
const r =
|
|
331
|
-
await new
|
|
332
|
-
const s =
|
|
333
|
-
return (await
|
|
330
|
+
const r = T("input");
|
|
331
|
+
await new Q(r, "w").write(e);
|
|
332
|
+
const s = T("output"), o = await ie(r, s, t, n);
|
|
333
|
+
return (await U(o)).arrayBuffer();
|
|
334
334
|
}
|
|
335
335
|
function fe(t) {
|
|
336
336
|
return [{ ...t, start: 0, end: t.length }];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function T(t) {
|
|
339
339
|
return `/tmp/${t}`;
|
|
340
340
|
}
|
|
341
341
|
function Ae(t, e, n) {
|
|
@@ -535,18 +535,18 @@ class Oe {
|
|
|
535
535
|
}
|
|
536
536
|
export {
|
|
537
537
|
$e as FetchError,
|
|
538
|
-
|
|
538
|
+
ge as JSONLoader,
|
|
539
539
|
Ne as NullLoader,
|
|
540
540
|
Ee as NullWorkerLoader,
|
|
541
541
|
ze as RequestScheduler,
|
|
542
542
|
Oe as _BrowserFileSystem,
|
|
543
543
|
We as _fetchProgress,
|
|
544
544
|
Ae as _selectSource,
|
|
545
|
-
|
|
546
|
-
|
|
545
|
+
Ce as _unregisterLoaders,
|
|
546
|
+
ve as assert,
|
|
547
547
|
z as concatenateArrayBuffersAsync,
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
Me as createDataSource,
|
|
549
|
+
Ue as document,
|
|
550
550
|
Be as encode,
|
|
551
551
|
Le as encodeInBatches,
|
|
552
552
|
ce as encodeSync,
|
|
@@ -556,33 +556,33 @@ export {
|
|
|
556
556
|
ke as encodeText,
|
|
557
557
|
Fe as encodeTextSync,
|
|
558
558
|
ie as encodeURLtoURL,
|
|
559
|
-
|
|
559
|
+
U as fetchFile,
|
|
560
560
|
je as forEach,
|
|
561
|
-
|
|
561
|
+
M as getLoaderOptions,
|
|
562
562
|
De as getPathPrefix,
|
|
563
|
-
|
|
564
|
-
|
|
563
|
+
qe as global,
|
|
564
|
+
Je as isAsyncIterable,
|
|
565
565
|
h as isBrowser,
|
|
566
566
|
Ve as isIterable,
|
|
567
567
|
Ge as isIterator,
|
|
568
568
|
He as isPromise,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
569
|
+
Qe as isPureObject,
|
|
570
|
+
Xe as isReadableStream,
|
|
571
|
+
Ye as isResponse,
|
|
572
|
+
Ze as isWorker,
|
|
573
|
+
Ke as isWritableStream,
|
|
574
574
|
et as load,
|
|
575
575
|
xe as loadInBatches,
|
|
576
576
|
tt as makeIterator,
|
|
577
577
|
pe as makeLineIterator,
|
|
578
|
-
|
|
578
|
+
be as makeNumberedLineIterator,
|
|
579
579
|
Re as makeStream,
|
|
580
580
|
me as makeTextDecoderIterator,
|
|
581
581
|
we as makeTextEncoderIterator,
|
|
582
582
|
k as parse,
|
|
583
583
|
l as parseInBatches,
|
|
584
584
|
Se as parseSync,
|
|
585
|
-
|
|
585
|
+
Te as readArrayBuffer,
|
|
586
586
|
nt as registerLoaders,
|
|
587
587
|
p as resolvePath,
|
|
588
588
|
P as selectLoader,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { y as
|
|
1
|
+
import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-JjyDEqAS.js";
|
|
2
|
+
import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as xe, n as je, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
|
|
3
3
|
import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
|
|
4
4
|
import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";
|
|
5
5
|
function de(t) {
|
|
6
6
|
switch (t.shape) {
|
|
7
7
|
case "array-row-table":
|
|
8
8
|
case "object-row-table":
|
|
9
|
-
return
|
|
9
|
+
return He(t.data);
|
|
10
10
|
case "geojson-table":
|
|
11
|
-
return
|
|
11
|
+
return Pe(t.features);
|
|
12
12
|
case "columnar-table":
|
|
13
|
-
return
|
|
13
|
+
return ze(t.data);
|
|
14
14
|
case "arrow-table":
|
|
15
15
|
default:
|
|
16
16
|
throw new Error("Deduce schema");
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function ze(t) {
|
|
20
20
|
const e = [];
|
|
21
21
|
for (const [r, s] of Object.entries(t)) {
|
|
22
22
|
const n = Qe(s, r);
|
|
@@ -24,7 +24,7 @@ function He(t) {
|
|
|
24
24
|
}
|
|
25
25
|
return { fields: e, metadata: {} };
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function He(t) {
|
|
28
28
|
if (!t.length)
|
|
29
29
|
throw new Error("deduce from empty table");
|
|
30
30
|
const e = [], r = t[0];
|
|
@@ -32,7 +32,7 @@ function Pe(t) {
|
|
|
32
32
|
e.push(me(n, s));
|
|
33
33
|
return { fields: e, metadata: {} };
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Pe(t) {
|
|
36
36
|
if (!t.length)
|
|
37
37
|
throw new Error("deduce from empty table");
|
|
38
38
|
const e = [], r = t[0].properties || {};
|
|
@@ -75,7 +75,7 @@ function Je(t, e) {
|
|
|
75
75
|
return new r(e);
|
|
76
76
|
}
|
|
77
77
|
function* We(t, e) {
|
|
78
|
-
const r = $e(t.schema), s = V(t), n = fe(t), a = s, c = r?.fields.map((o) =>
|
|
78
|
+
const r = $e(t.schema), s = V(t), n = fe(t), a = s, c = r?.fields.map((o) => ve(o)), h = new he(r.fields);
|
|
79
79
|
let f = 0;
|
|
80
80
|
for (let o = 0; o < s; o++)
|
|
81
81
|
for (let u = 0; u < n; ++u) {
|
|
@@ -393,7 +393,7 @@ class at extends we {
|
|
|
393
393
|
const e = super.getBatch();
|
|
394
394
|
if (e) {
|
|
395
395
|
this.arrowSchema = this.arrowSchema || ot(e.schema);
|
|
396
|
-
const r = lt(this.arrowSchema, e.data), s = new J(this.arrowSchema,
|
|
396
|
+
const r = lt(this.arrowSchema, e.data), s = new J(this.arrowSchema, Fe({
|
|
397
397
|
type: new he(this.arrowSchema.fields),
|
|
398
398
|
children: r.map(({ data: n }) => n[0])
|
|
399
399
|
}));
|
|
@@ -412,7 +412,7 @@ function ot(t) {
|
|
|
412
412
|
for (const r in t) {
|
|
413
413
|
const s = t[r];
|
|
414
414
|
if (s.type === Float32Array) {
|
|
415
|
-
const n = /* @__PURE__ */ new Map(), a = new
|
|
415
|
+
const n = /* @__PURE__ */ new Map(), a = new xe(s.name, new je(), s.nullable, n);
|
|
416
416
|
e.push(a);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -578,7 +578,7 @@ class ut {
|
|
|
578
578
|
});
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
const re = "\uFEFF",
|
|
581
|
+
const re = "\uFEFF", F = {
|
|
582
582
|
RECORD_SEP: "",
|
|
583
583
|
UNIT_SEP: "",
|
|
584
584
|
BYTE_ORDER_MARK: re,
|
|
@@ -620,7 +620,7 @@ let ye = class {
|
|
|
620
620
|
}
|
|
621
621
|
// eslint-disable-next-line complexity, max-statements
|
|
622
622
|
parseChunk(e, r) {
|
|
623
|
-
if (this.isFirstChunk &&
|
|
623
|
+
if (this.isFirstChunk && x(this._config.beforeFirstChunk)) {
|
|
624
624
|
const h = this._config.beforeFirstChunk(e);
|
|
625
625
|
h !== void 0 && (e = h);
|
|
626
626
|
}
|
|
@@ -633,15 +633,15 @@ let ye = class {
|
|
|
633
633
|
const a = n.meta.cursor;
|
|
634
634
|
this._finished || (this._partialLine = s.substring(a - this._baseIndex), this._baseIndex = a), n && n.data && (this._rowCount += n.data.length);
|
|
635
635
|
const c = this._finished || this._config.preview && this._rowCount >= this._config.preview;
|
|
636
|
-
if (
|
|
636
|
+
if (x(this._config.chunk) && !r) {
|
|
637
637
|
if (this._config.chunk(n, this._handle), this._handle.paused() || this._handle.aborted())
|
|
638
638
|
return;
|
|
639
639
|
n = void 0, this._completeResults = void 0;
|
|
640
640
|
}
|
|
641
|
-
return !this._config.step && !this._config.chunk && (this._completeResults.data = this._completeResults.data.concat(n.data), this._completeResults.errors = this._completeResults.errors.concat(n.errors), this._completeResults.meta = n.meta), !this._completed && c &&
|
|
641
|
+
return !this._config.step && !this._config.chunk && (this._completeResults.data = this._completeResults.data.concat(n.data), this._completeResults.errors = this._completeResults.errors.concat(n.errors), this._completeResults.meta = n.meta), !this._completed && c && x(this._config.complete) && (!n || !n.meta.aborted) && (this._config.complete(this._completeResults, this._input), this._completed = !0), n;
|
|
642
642
|
}
|
|
643
643
|
_sendError(e) {
|
|
644
|
-
|
|
644
|
+
x(this._config.error) && this._config.error(e);
|
|
645
645
|
}
|
|
646
646
|
};
|
|
647
647
|
class dt extends ye {
|
|
@@ -685,7 +685,7 @@ class be {
|
|
|
685
685
|
meta: {}
|
|
686
686
|
};
|
|
687
687
|
constructor(e) {
|
|
688
|
-
if (
|
|
688
|
+
if (x(e.step)) {
|
|
689
689
|
const r = e.step;
|
|
690
690
|
e.step = (s) => {
|
|
691
691
|
if (this._results = s, this.needsHeaderRow())
|
|
@@ -707,10 +707,10 @@ class be {
|
|
|
707
707
|
parse(e, r, s) {
|
|
708
708
|
const n = this._config.quoteChar || '"';
|
|
709
709
|
if (this._config.newline || (this._config.newline = gt(e, n)), this._delimiterError = !1, this._config.delimiter)
|
|
710
|
-
|
|
710
|
+
x(this._config.delimiter) && (this._config.delimiter = this._config.delimiter(e), this._results.meta.delimiter = this._config.delimiter);
|
|
711
711
|
else {
|
|
712
712
|
const c = this.guessDelimiter(e, this._config.newline, this._config.skipEmptyLines, this._config.comments, this._config.delimitersToGuess);
|
|
713
|
-
c.successful ? this._config.delimiter = c.bestDelimiter : (this._delimiterError = !0, this._config.delimiter =
|
|
713
|
+
c.successful ? this._config.delimiter = c.bestDelimiter : (this._delimiterError = !0, this._config.delimiter = F.DefaultDelimiter), this._results.meta.delimiter = this._config.delimiter;
|
|
714
714
|
}
|
|
715
715
|
const a = _e(this._config);
|
|
716
716
|
return this._config.preview && this._config.header && a.preview++, this._input = e, this._parser = new W(a), this._results = this._parser.parse(this._input, r, s), this.processResults(), this._paused ? { meta: { paused: !0 } } : this._results || { meta: { paused: !1 } };
|
|
@@ -728,13 +728,13 @@ class be {
|
|
|
728
728
|
return this._aborted;
|
|
729
729
|
}
|
|
730
730
|
abort() {
|
|
731
|
-
this._aborted = !0, this._parser.abort(), this._results.meta.aborted = !0,
|
|
731
|
+
this._aborted = !0, this._parser.abort(), this._results.meta.aborted = !0, x(this._config.complete) && this._config.complete(this._results), this._input = "";
|
|
732
732
|
}
|
|
733
733
|
testEmptyLine(e) {
|
|
734
734
|
return this._config.skipEmptyLines === "greedy" ? e.join("").trim() === "" : e.length === 1 && e[0].length === 0;
|
|
735
735
|
}
|
|
736
736
|
processResults() {
|
|
737
|
-
if (this._results && this._delimiterError && (this.addError("Delimiter", "UndetectableDelimiter", `Unable to auto-detect delimiting character; defaulted to '${
|
|
737
|
+
if (this._results && this._delimiterError && (this.addError("Delimiter", "UndetectableDelimiter", `Unable to auto-detect delimiting character; defaulted to '${F.DefaultDelimiter}'`), this._delimiterError = !1), this._config.skipEmptyLines)
|
|
738
738
|
for (let e = 0; e < this._results.data.length; e++)
|
|
739
739
|
this.testEmptyLine(this._results.data[e]) && this._results.data.splice(e--, 1);
|
|
740
740
|
return this.needsHeaderRow() && this.fillHeaderFields(), this.applyHeaderAndDynamicTypingAndTransformation();
|
|
@@ -746,7 +746,7 @@ class be {
|
|
|
746
746
|
if (!this._results)
|
|
747
747
|
return;
|
|
748
748
|
const e = (r) => {
|
|
749
|
-
|
|
749
|
+
x(this._config.transformHeader) && (r = this._config.transformHeader(r)), this._fields.push(r);
|
|
750
750
|
};
|
|
751
751
|
if (Array.isArray(this._results.data[0])) {
|
|
752
752
|
for (let r = 0; this.needsHeaderRow() && r < this._results.data.length; r++)
|
|
@@ -779,7 +779,7 @@ class be {
|
|
|
779
779
|
// eslint-disable-next-line complexity, max-statements
|
|
780
780
|
guessDelimiter(e, r, s, n, a) {
|
|
781
781
|
let c, h, f;
|
|
782
|
-
a = a || [",", " ", "|", ";",
|
|
782
|
+
a = a || [",", " ", "|", ";", F.RECORD_SEP, F.UNIT_SEP];
|
|
783
783
|
for (let o = 0; o < a.length; o++) {
|
|
784
784
|
const u = a[o];
|
|
785
785
|
let i = 0, d = 0, g = 0;
|
|
@@ -842,9 +842,9 @@ function W(t = {}) {
|
|
|
842
842
|
let h;
|
|
843
843
|
t.quoteChar === void 0 ? h = '"' : h = t.quoteChar;
|
|
844
844
|
let f = h;
|
|
845
|
-
if (t.escapeChar !== void 0 && (f = t.escapeChar), (typeof e != "string" ||
|
|
845
|
+
if (t.escapeChar !== void 0 && (f = t.escapeChar), (typeof e != "string" || F.BAD_DELIMITERS.indexOf(e) > -1) && (e = ","), s === e)
|
|
846
846
|
throw new Error("Comment character same as delimiter");
|
|
847
|
-
s === !0 ? s = "#" : (typeof s != "string" ||
|
|
847
|
+
s === !0 ? s = "#" : (typeof s != "string" || F.BAD_DELIMITERS.indexOf(s) > -1) && (s = !1), r !== `
|
|
848
848
|
` && r !== "\r" && r !== `\r
|
|
849
849
|
` && (r = `
|
|
850
850
|
`);
|
|
@@ -852,9 +852,9 @@ function W(t = {}) {
|
|
|
852
852
|
this.parse = function(i, d, g) {
|
|
853
853
|
if (typeof i != "string")
|
|
854
854
|
throw new Error("Input must be a string");
|
|
855
|
-
const w = i.length, l = e.length, m = r.length, C = s.length, T =
|
|
855
|
+
const w = i.length, l = e.length, m = r.length, C = s.length, T = x(n);
|
|
856
856
|
o = 0;
|
|
857
|
-
let y = [],
|
|
857
|
+
let y = [], v = [], p = [], k = 0;
|
|
858
858
|
if (!i)
|
|
859
859
|
return S();
|
|
860
860
|
if (c || c !== !1 && i.indexOf(h) === -1) {
|
|
@@ -867,10 +867,10 @@ function W(t = {}) {
|
|
|
867
867
|
return S();
|
|
868
868
|
if (!(s && O.substr(0, C) === s)) {
|
|
869
869
|
if (T) {
|
|
870
|
-
if (y = [],
|
|
870
|
+
if (y = [], j(O.split(e)), I(), u)
|
|
871
871
|
return S();
|
|
872
872
|
} else
|
|
873
|
-
|
|
873
|
+
j(O.split(e));
|
|
874
874
|
if (a && D >= a)
|
|
875
875
|
return y = y.slice(0, a), S(!0);
|
|
876
876
|
}
|
|
@@ -884,17 +884,17 @@ function W(t = {}) {
|
|
|
884
884
|
if (i[o] === h) {
|
|
885
885
|
for (b = o, o++; ; ) {
|
|
886
886
|
if (b = i.indexOf(h, b + 1), b === -1)
|
|
887
|
-
return g ||
|
|
887
|
+
return g || v.push({
|
|
888
888
|
type: "Quotes",
|
|
889
889
|
code: "MissingQuotes",
|
|
890
890
|
message: "Quoted field unterminated",
|
|
891
891
|
row: y.length,
|
|
892
892
|
// row has yet to be inserted
|
|
893
893
|
index: o
|
|
894
|
-
}),
|
|
894
|
+
}), z();
|
|
895
895
|
if (b === w - 1) {
|
|
896
896
|
const Ee = i.substring(o, b).replace(B, h);
|
|
897
|
-
return
|
|
897
|
+
return z(Ee);
|
|
898
898
|
}
|
|
899
899
|
if (h === f && i[b + 1] === f) {
|
|
900
900
|
b++;
|
|
@@ -918,7 +918,7 @@ function W(t = {}) {
|
|
|
918
918
|
return S(!0);
|
|
919
919
|
break;
|
|
920
920
|
}
|
|
921
|
-
|
|
921
|
+
v.push({
|
|
922
922
|
type: "Quotes",
|
|
923
923
|
code: "InvalidQuotes",
|
|
924
924
|
message: "Trailing quote on quoted field is malformed",
|
|
@@ -952,8 +952,8 @@ function W(t = {}) {
|
|
|
952
952
|
}
|
|
953
953
|
break;
|
|
954
954
|
}
|
|
955
|
-
return
|
|
956
|
-
function
|
|
955
|
+
return z();
|
|
956
|
+
function j(R) {
|
|
957
957
|
y.push(R), k = o;
|
|
958
958
|
}
|
|
959
959
|
function K(R) {
|
|
@@ -964,16 +964,16 @@ function W(t = {}) {
|
|
|
964
964
|
}
|
|
965
965
|
return D;
|
|
966
966
|
}
|
|
967
|
-
function
|
|
968
|
-
return g || (typeof R > "u" && (R = i.substr(o)), p.push(R), o = w,
|
|
967
|
+
function z(R) {
|
|
968
|
+
return g || (typeof R > "u" && (R = i.substr(o)), p.push(R), o = w, j(p), T && I()), S();
|
|
969
969
|
}
|
|
970
970
|
function Y(R) {
|
|
971
|
-
o = R,
|
|
971
|
+
o = R, j(p), p = [], _ = i.indexOf(r, o);
|
|
972
972
|
}
|
|
973
973
|
function S(R, D) {
|
|
974
974
|
return {
|
|
975
975
|
data: D || !1 ? y[0] : y,
|
|
976
|
-
errors:
|
|
976
|
+
errors: v,
|
|
977
977
|
meta: {
|
|
978
978
|
delimiter: e,
|
|
979
979
|
linebreak: r,
|
|
@@ -984,7 +984,7 @@ function W(t = {}) {
|
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
986
|
function I() {
|
|
987
|
-
n(S(void 0, !0)), y = [],
|
|
987
|
+
n(S(void 0, !0)), y = [], v = [];
|
|
988
988
|
}
|
|
989
989
|
}, this.abort = function() {
|
|
990
990
|
u = !0;
|
|
@@ -1000,7 +1000,7 @@ function _e(t) {
|
|
|
1000
1000
|
e[r] = _e(t[r]);
|
|
1001
1001
|
return e;
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function x(t) {
|
|
1004
1004
|
return typeof t == "function";
|
|
1005
1005
|
}
|
|
1006
1006
|
function wt(t, e = {}) {
|
|
@@ -1018,7 +1018,7 @@ function wt(t, e = {}) {
|
|
|
1018
1018
|
throw new Error("Unable to serialize unrecognized input");
|
|
1019
1019
|
function i() {
|
|
1020
1020
|
if (typeof e == "object") {
|
|
1021
|
-
if (typeof e.delimiter == "string" && !
|
|
1021
|
+
if (typeof e.delimiter == "string" && !F.BAD_DELIMITERS.filter(function(l) {
|
|
1022
1022
|
return e.delimiter?.indexOf(l) !== -1;
|
|
1023
1023
|
}).length && (n = e.delimiter), (typeof e.quotes == "boolean" || Array.isArray(e.quotes)) && (r = e.quotes), (typeof e.skipEmptyLines == "boolean" || e.skipEmptyLines === "greedy") && (f = e.skipEmptyLines), typeof e.newline == "string" && (a = e.newline), typeof e.quoteChar == "string" && (c = e.quoteChar), typeof e.header == "boolean" && (s = e.header), Array.isArray(e.columns)) {
|
|
1024
1024
|
if (e.columns.length === 0)
|
|
@@ -1031,7 +1031,7 @@ function wt(t, e = {}) {
|
|
|
1031
1031
|
function d(l, m, C) {
|
|
1032
1032
|
let T = "";
|
|
1033
1033
|
typeof l == "string" && (l = JSON.parse(l)), typeof m == "string" && (m = JSON.parse(m));
|
|
1034
|
-
const y = Array.isArray(l) && l.length > 0,
|
|
1034
|
+
const y = Array.isArray(l) && l.length > 0, v = !Array.isArray(m[0]);
|
|
1035
1035
|
if (y && s) {
|
|
1036
1036
|
for (let p = 0; p < l.length; p++)
|
|
1037
1037
|
p > 0 && (T += n), T += g(l[p], p);
|
|
@@ -1044,15 +1044,15 @@ function wt(t, e = {}) {
|
|
|
1044
1044
|
if (C && !y && (A = C === "greedy" ? m[p].join("").trim() === "" : m[p].length === 1 && m[p][0].length === 0), C === "greedy" && y) {
|
|
1045
1045
|
const B = [];
|
|
1046
1046
|
for (let b = 0; b < k; b++) {
|
|
1047
|
-
const
|
|
1048
|
-
B.push(m[p][
|
|
1047
|
+
const j = v ? l[b] : b;
|
|
1048
|
+
B.push(m[p][j]);
|
|
1049
1049
|
}
|
|
1050
1050
|
A = B.join("").trim() === "";
|
|
1051
1051
|
}
|
|
1052
1052
|
if (!A) {
|
|
1053
1053
|
for (let B = 0; B < k; B++) {
|
|
1054
1054
|
B > 0 && !_ && (T += n);
|
|
1055
|
-
const b = y &&
|
|
1055
|
+
const b = y && v ? l[B] : B;
|
|
1056
1056
|
T += g(m[p][b], B);
|
|
1057
1057
|
}
|
|
1058
1058
|
p < m.length - 1 && (!C || k > 0 && !_) && (T += a);
|
|
@@ -1061,7 +1061,7 @@ function wt(t, e = {}) {
|
|
|
1061
1061
|
return T;
|
|
1062
1062
|
}
|
|
1063
1063
|
function g(l, m) {
|
|
1064
|
-
return typeof l > "u" || l === null ? "" : l.constructor === Date ? JSON.stringify(l).slice(1, 25) : (l = l.toString().replace(u, h), typeof r == "boolean" && r || Array.isArray(r) && r[m] || w(l,
|
|
1064
|
+
return typeof l > "u" || l === null ? "" : l.constructor === Date ? JSON.stringify(l).slice(1, 25) : (l = l.toString().replace(u, h), typeof r == "boolean" && r || Array.isArray(r) && r[m] || w(l, F.BAD_DELIMITERS) || l.indexOf(n) > -1 || l.charAt(0) === " " || l.charAt(l.length - 1) === " " ? c + l + c : l);
|
|
1065
1065
|
}
|
|
1066
1066
|
function w(l, m) {
|
|
1067
1067
|
for (let C = 0; C < m.length; C++)
|
|
@@ -1074,7 +1074,7 @@ function yt(t) {
|
|
|
1074
1074
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1075
1075
|
}
|
|
1076
1076
|
const $ = {
|
|
1077
|
-
...
|
|
1077
|
+
...F,
|
|
1078
1078
|
parse: ft,
|
|
1079
1079
|
unparse: wt,
|
|
1080
1080
|
ChunkStreamer: ye,
|
|
@@ -1294,7 +1294,7 @@ function Rt(t, e) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
|
-
var ne = {},
|
|
1297
|
+
var ne = {}, H = {}, P = 34, N = 10, Q = 13;
|
|
1298
1298
|
function Se(t) {
|
|
1299
1299
|
return new Function("d", "return {" + t.map(function(e, r) {
|
|
1300
1300
|
return JSON.stringify(e) + ": d[" + r + '] || ""';
|
|
@@ -1337,12 +1337,12 @@ function Dt(t) {
|
|
|
1337
1337
|
function n(i, d) {
|
|
1338
1338
|
var g = [], w = i.length, l = 0, m = 0, C, T = w <= 0, y = !1;
|
|
1339
1339
|
i.charCodeAt(w - 1) === N && --w, i.charCodeAt(w - 1) === Q && --w;
|
|
1340
|
-
function
|
|
1341
|
-
if (T) return
|
|
1340
|
+
function v() {
|
|
1341
|
+
if (T) return H;
|
|
1342
1342
|
if (y) return y = !1, ne;
|
|
1343
1343
|
var k, A = l, _;
|
|
1344
|
-
if (i.charCodeAt(A) ===
|
|
1345
|
-
for (; l++ < w && i.charCodeAt(l) !==
|
|
1344
|
+
if (i.charCodeAt(A) === P) {
|
|
1345
|
+
for (; l++ < w && i.charCodeAt(l) !== P || i.charCodeAt(++l) === P; ) ;
|
|
1346
1346
|
return (k = l) >= w ? T = !0 : (_ = i.charCodeAt(l++)) === N ? y = !0 : _ === Q && (y = !0, i.charCodeAt(l) === N && ++l), i.slice(A + 1, k - 1).replace(/""/g, '"');
|
|
1347
1347
|
}
|
|
1348
1348
|
for (; l < w; ) {
|
|
@@ -1354,8 +1354,8 @@ function Dt(t) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
return T = !0, i.slice(A, w);
|
|
1356
1356
|
}
|
|
1357
|
-
for (; (C =
|
|
1358
|
-
for (var p = []; C !== ne && C !==
|
|
1357
|
+
for (; (C = v()) !== H; ) {
|
|
1358
|
+
for (var p = []; C !== ne && C !== H; ) p.push(C), C = v();
|
|
1359
1359
|
d && (p = d(p, m++)) == null || g.push(p);
|
|
1360
1360
|
}
|
|
1361
1361
|
return g;
|
|
@@ -1405,14 +1405,14 @@ function ae(t, e = { csv: { useDisplayNames: !0 } }) {
|
|
|
1405
1405
|
const f = [];
|
|
1406
1406
|
for (let o = 0; o < fe(t); ++o) {
|
|
1407
1407
|
const u = h[o];
|
|
1408
|
-
f[o] =
|
|
1408
|
+
f[o] = vt(u);
|
|
1409
1409
|
}
|
|
1410
1410
|
a.push(f);
|
|
1411
1411
|
}
|
|
1412
1412
|
const c = a.map((h) => h.map((f) => f === null ? "" : f));
|
|
1413
1413
|
return kt(c);
|
|
1414
1414
|
}
|
|
1415
|
-
const
|
|
1415
|
+
const vt = (t) => t == null ? null : t instanceof Date ? t.toISOString() : typeof t == "object" ? JSON.stringify(t) : String(t), Ut = {
|
|
1416
1416
|
...Ce,
|
|
1417
1417
|
version: "latest",
|
|
1418
1418
|
options: {
|
|
@@ -1429,13 +1429,13 @@ const Ft = (t) => t == null ? null : t instanceof Date ? t.toISOString() : typeo
|
|
|
1429
1429
|
batchType: null,
|
|
1430
1430
|
parse: async (t, e) => oe(new TextDecoder().decode(t), e),
|
|
1431
1431
|
parseText: (t, e) => oe(t, e),
|
|
1432
|
-
parseInBatches:
|
|
1432
|
+
parseInBatches: Ft
|
|
1433
1433
|
};
|
|
1434
1434
|
async function oe(t, e) {
|
|
1435
1435
|
const r = await U.parseText(t, e);
|
|
1436
1436
|
return L(r, "arrow-table");
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1438
|
+
function Ft(t, e) {
|
|
1439
1439
|
const r = U.parseInBatches(t, e);
|
|
1440
1440
|
return rt(r, "arrow-table");
|
|
1441
1441
|
}
|