@dpuse/dpuse-tool-file-previewer 1.0.119 → 1.0.121
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/README.md
CHANGED
|
@@ -65,7 +65,7 @@ License data is updated each time `npm run document` is run, using [license-chec
|
|
|
65
65
|
| Dependency | Version | License(s) | Document |
|
|
66
66
|
| :--------------------------------------------------------------------- | :-----: | :--------- | :-------------------------------------------------------------------- |
|
|
67
67
|
| [@borewit/text-codec](https://github.com/Borewit/text-codec) | 0.2.2 | MIT | [LICENSE](licenses/downloads/@borewit/text-codec@0.2.2-LICENSE.txt) |
|
|
68
|
-
| [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.
|
|
68
|
+
| [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.135 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.135-LICENSE.txt) |
|
|
69
69
|
| [@tokenizer/inflate](https://github.com/Borewit/tokenizer-inflate) | 0.5.1 | MIT | [LICENSE](licenses/downloads/@tokenizer/inflate@0.5.1-LICENSE.txt) |
|
|
70
70
|
| [debug](https://github.com/debug-js/debug) | 4.4.3 | MIT | [LICENSE](licenses/downloads/debug@4.4.3-LICENSE.txt) |
|
|
71
71
|
| [file-type](https://github.com/sindresorhus/file-type) | 22.2.0 | MIT | [LICENSE](licenses/downloads/file-type@22.2.0-LICENSE.txt) |
|
|
@@ -80,7 +80,7 @@ License data is updated each time `npm run document` is run, using [license-chec
|
|
|
80
80
|
|
|
81
81
|
The dependency tree below shows how each package in the table above is reached — direct and transitive — along with its installed version, release date, and update status. A package that does not ship itself, such as one whose parts are bundled separately, is left out and what ships beneath it is shown in its place. Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.
|
|
82
82
|
|
|
83
|
-
- **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.
|
|
83
|
+
- **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.135 — this month: 2026-10-25
|
|
84
84
|
- **[file-type](https://github.com/sindresorhus/file-type)** 22.2.0 — this month: 2026-10-14
|
|
85
85
|
- **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 1 mth ago: 2026-09-09
|
|
86
86
|
- **[file-type](https://github.com/sindresorhus/file-type)** 22.2.0 — this month: 2026-10-14
|
|
@@ -105,23 +105,23 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
|
|
|
105
105
|
|
|
106
106
|
| Chunk/Module/File | Composition |
|
|
107
107
|
| :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ |
|
|
108
|
-
| **dist/dpuse-tool-file-previewer.es.js** | 1238.
|
|
108
|
+
| **dist/dpuse-tool-file-previewer.es.js** | 1238.8 kB · gzip 718.1 kB · 100.0% of the build |
|
|
109
109
|
| jschardet → dist/jschardet.esm.min.js | `██████████████████░░` 90.6% · 1122.3 kB |
|
|
110
110
|
| file-type → source/index.js + 7 more | `█░░░░░░░░░░░░░░░░░░░` 3.7% · 45.3 kB |
|
|
111
111
|
| ↳ 8 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 3.7% · 45.3 kB |
|
|
112
|
-
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `░░░░░░░░░░░░░░░░░░░░` 1.2% · 15.
|
|
112
|
+
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `░░░░░░░░░░░░░░░░░░░░` 1.2% · 15.4 kB |
|
|
113
113
|
| strtok3 → lib/AbstractTokenizer.js + 12 more | `░░░░░░░░░░░░░░░░░░░░` 0.8% · 9.4 kB |
|
|
114
114
|
| ↳ 13 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.8% · 9.4 kB |
|
|
115
115
|
| @tokenizer/inflate → lib/ZipHandler.js + 3 more | `░░░░░░░░░░░░░░░░░░░░` 0.7% · 8.4 kB |
|
|
116
116
|
| ↳ 4 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.7% · 8.4 kB |
|
|
117
|
-
| src → index.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% · 6.
|
|
117
|
+
| src → index.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% · 6.7 kB |
|
|
118
118
|
| debug → src/browser.js + 1 more | `░░░░░░░░░░░░░░░░░░░░` 0.4% · 5.1 kB |
|
|
119
119
|
| ↳ 2 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.4% · 5.1 kB |
|
|
120
120
|
| @borewit/text-codec → lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 0.3% · 3.3 kB |
|
|
121
121
|
| ms → index.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% · 1.6 kB |
|
|
122
122
|
| uint8array-extras → index.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% · 1.2 kB |
|
|
123
123
|
| token-types → lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% · 1018 B |
|
|
124
|
-
| (bundler output, whitespace & JSON) | `░░░░░░░░░░░░░░░░░░░░` 1.
|
|
124
|
+
| (bundler output, whitespace & JSON) | `░░░░░░░░░░░░░░░░░░░░` 1.5% · 19.2 kB |
|
|
125
125
|
|
|
126
126
|
Bars show each row's share of its output file. ↳ rows are part of the row above.
|
|
127
127
|
|
|
@@ -8399,7 +8399,7 @@ var bc = {
|
|
|
8399
8399
|
status: /* @__PURE__ */ Z(vc),
|
|
8400
8400
|
statusId: /* @__PURE__ */ Z(_c)
|
|
8401
8401
|
};
|
|
8402
|
-
({ ...bc }), Y({ en: "Data Positioning Events" }), Y({ en: "Delimited Text" }), Y({ en: "JSON" }), Y({ en: "JSON Lines" }), Y({ en: "Markdown" }), Y({ en: "SPSS" }), Y({ en: "Plain Text" }), Y({ en: "XLSX" }), Y({ en: "XML" }), Y({ en: "Newline" }), Y({ en: "Carriage Return" }), Y({ en: "Carriage Return/Newline" }), Y({ en: "Colon" }), Y({ en: "Comma" }), Y({ en: "Exclamation Mark" }), Y({ en: "Record Separator" }), Y({ en: "Semicolon" }), Y({ en: "Space" }), Y({ en: "Tab" }), Y({ en: "Underscore" }), Y({ en: "Unit Separator" }), Y({ en: "Vertical Bar" }), $([
|
|
8402
|
+
({ ...bc }), Y({ en: "Apache Arrow" }), Y({ en: "Apache Avro" }), Y({ en: "Data Positioning Events" }), Y({ en: "Delimited Text" }), Y({ en: "JSON" }), Y({ en: "JSON Lines" }), Y({ en: "Markdown" }), Y({ en: "OpenDocument Spreadsheet" }), Y({ en: "Apache Parquet" }), Y({ en: "SPSS" }), Y({ en: "SQLite" }), Y({ en: "Plain Text" }), Y({ en: "XLSM" }), Y({ en: "XLSX" }), Y({ en: "XML" }), Y({ en: "Newline" }), Y({ en: "Carriage Return" }), Y({ en: "Carriage Return/Newline" }), Y({ en: "Colon" }), Y({ en: "Comma" }), Y({ en: "Exclamation Mark" }), Y({ en: "Record Separator" }), Y({ en: "Semicolon" }), Y({ en: "Space" }), Y({ en: "Tab" }), Y({ en: "Underscore" }), Y({ en: "Unit Separator" }), Y({ en: "Vertical Bar" }), $([
|
|
8403
8403
|
"app",
|
|
8404
8404
|
"engine",
|
|
8405
8405
|
"connector",
|
|
@@ -8938,99 +8938,87 @@ function Mc(e) {
|
|
|
8938
8938
|
return n > t && n < e.length - 1 ? n : void 0;
|
|
8939
8939
|
}
|
|
8940
8940
|
// src/index.ts
|
|
8941
|
-
var Nc = .2, Pc = 4096, Fc = {
|
|
8941
|
+
var Nc = .2, Pc = 4096, Fc = 65536, Ic = {
|
|
8942
8942
|
id: "utf-8",
|
|
8943
8943
|
confidenceLevel: void 0
|
|
8944
|
-
},
|
|
8944
|
+
}, Lc = 256, Rc = /^<\?xml\s[^?]*?\bencoding\s*=\s*(["'])([A-Za-z][\w.:-]*)\1/, zc = [
|
|
8945
8945
|
"false",
|
|
8946
8946
|
"null",
|
|
8947
8947
|
"true"
|
|
8948
|
-
],
|
|
8948
|
+
], Bc = /* @__PURE__ */ new Set([
|
|
8949
8949
|
" ",
|
|
8950
8950
|
" ",
|
|
8951
8951
|
"\n",
|
|
8952
8952
|
"\r"
|
|
8953
|
-
]),
|
|
8954
|
-
markdown: "markdown",
|
|
8955
|
-
md: "markdown"
|
|
8956
|
-
}, Vc = {
|
|
8953
|
+
]), Vc = /* @__PURE__ */ new Set(["markdown", "md"]), Hc = "text/markdown", Uc = "application/octet-stream", Wc = {
|
|
8957
8954
|
arrow: {
|
|
8958
8955
|
label: "Columnar format for tables of data.",
|
|
8959
8956
|
structure: "table",
|
|
8960
|
-
isAutoDetectable: !0
|
|
8961
|
-
isSupported: !1
|
|
8957
|
+
isAutoDetectable: !0
|
|
8962
8958
|
},
|
|
8963
8959
|
avro: {
|
|
8964
8960
|
label: "Object container file developed by Apache Avro.",
|
|
8965
8961
|
structure: "records",
|
|
8966
|
-
isAutoDetectable: !0
|
|
8967
|
-
isSupported: !1
|
|
8962
|
+
isAutoDetectable: !0
|
|
8968
8963
|
},
|
|
8969
8964
|
ods: {
|
|
8970
8965
|
label: "OpenDocument for spreadsheets.",
|
|
8971
8966
|
structure: "workbook",
|
|
8972
|
-
isAutoDetectable: !0
|
|
8973
|
-
isSupported: !1
|
|
8967
|
+
isAutoDetectable: !0
|
|
8974
8968
|
},
|
|
8975
8969
|
parquet: {
|
|
8976
8970
|
label: "Apache Parquet.",
|
|
8977
8971
|
structure: "table",
|
|
8978
|
-
isAutoDetectable: !0
|
|
8979
|
-
isSupported: !1
|
|
8972
|
+
isAutoDetectable: !0
|
|
8980
8973
|
},
|
|
8981
8974
|
sav: {
|
|
8982
8975
|
label: "SPSS statistical data file.",
|
|
8983
8976
|
structure: "table",
|
|
8984
|
-
isAutoDetectable: !0
|
|
8985
|
-
isSupported: !1
|
|
8977
|
+
isAutoDetectable: !0
|
|
8986
8978
|
},
|
|
8987
8979
|
sqlite: {
|
|
8988
8980
|
label: "SQLite file.",
|
|
8989
8981
|
structure: "database",
|
|
8990
|
-
isAutoDetectable: !0
|
|
8991
|
-
isSupported: !1
|
|
8982
|
+
isAutoDetectable: !0
|
|
8992
8983
|
},
|
|
8993
8984
|
xlsx: {
|
|
8994
8985
|
label: "Microsoft Excel document.",
|
|
8995
8986
|
structure: "workbook",
|
|
8996
|
-
isAutoDetectable: !0
|
|
8997
|
-
isSupported: !1
|
|
8987
|
+
isAutoDetectable: !0
|
|
8998
8988
|
},
|
|
8999
8989
|
xlsm: {
|
|
9000
8990
|
label: "Microsoft Excel macro-enabled document.",
|
|
9001
8991
|
structure: "workbook",
|
|
9002
|
-
isAutoDetectable: !0
|
|
9003
|
-
isSupported: !1
|
|
8992
|
+
isAutoDetectable: !0
|
|
9004
8993
|
},
|
|
9005
8994
|
xml: {
|
|
9006
8995
|
label: "eXtensible markup language.",
|
|
9007
8996
|
structure: "tree",
|
|
9008
|
-
isAutoDetectable: !0
|
|
9009
|
-
isSupported: !1
|
|
8997
|
+
isAutoDetectable: !0
|
|
9010
8998
|
}
|
|
9011
|
-
},
|
|
9012
|
-
async previewFile(e, t, n, r = Nc) {
|
|
9013
|
-
let
|
|
9014
|
-
headers: { Range: `bytes=0-${String(
|
|
8999
|
+
}, Gc = class {
|
|
9000
|
+
async previewFile(e, t, n, r, i = Nc) {
|
|
9001
|
+
let a = el(r, jc(new URL(e).pathname)?.toLowerCase()), o = n ?? (a ? Fc : Pc), s = await fetch(encodeURI(e), {
|
|
9002
|
+
headers: { Range: `bytes=0-${String(o - 1)}` },
|
|
9015
9003
|
signal: t
|
|
9016
|
-
})
|
|
9017
|
-
if (
|
|
9018
|
-
...await
|
|
9004
|
+
});
|
|
9005
|
+
if (s.status === 416) return {
|
|
9006
|
+
...await qc(/* @__PURE__ */ new Uint8Array(), a, i, !0),
|
|
9019
9007
|
isComplete: !0
|
|
9020
9008
|
};
|
|
9021
|
-
if (!
|
|
9022
|
-
let
|
|
9009
|
+
if (!s.ok) throw await Tc(s, `Failed to fetch '${e}' file.`, "dpuse-tool-file-previewer.previewRemoteFile");
|
|
9010
|
+
let c = new Uint8Array(await s.arrayBuffer()), l = Kc(s, c.length, o);
|
|
9023
9011
|
return {
|
|
9024
|
-
...await
|
|
9025
|
-
isComplete:
|
|
9012
|
+
...await qc(c, a, i, l),
|
|
9013
|
+
isComplete: l
|
|
9026
9014
|
};
|
|
9027
9015
|
}
|
|
9028
9016
|
};
|
|
9029
|
-
function
|
|
9017
|
+
function Kc(e, t, n) {
|
|
9030
9018
|
let r = /\/(\d+)$/.exec(e.headers.get("content-range") ?? "")?.[1];
|
|
9031
9019
|
return r == null ? e.status !== 206 || t < n : t >= Number(r);
|
|
9032
9020
|
}
|
|
9033
|
-
async function
|
|
9021
|
+
async function qc(e, t, n, r) {
|
|
9034
9022
|
if (e.length === 0) return {
|
|
9035
9023
|
bytes: e,
|
|
9036
9024
|
dataFormatId: void 0,
|
|
@@ -9041,11 +9029,11 @@ async function Wc(e, t, n, r) {
|
|
|
9041
9029
|
text: void 0
|
|
9042
9030
|
};
|
|
9043
9031
|
let i = await Qs(e);
|
|
9044
|
-
if (i != null) return
|
|
9045
|
-
let a =
|
|
9032
|
+
if (i != null) return Jc(e, i, r);
|
|
9033
|
+
let a = Xc(e, n), o = $c(e, a[0] ?? Ic, r);
|
|
9046
9034
|
return {
|
|
9047
9035
|
bytes: e,
|
|
9048
|
-
dataFormatId:
|
|
9036
|
+
dataFormatId: tl(o.text, t),
|
|
9049
9037
|
encodingId: o.encoding.id,
|
|
9050
9038
|
encodingConfidenceLevel: o.encoding.confidenceLevel,
|
|
9051
9039
|
encodingCandidates: a,
|
|
@@ -9053,11 +9041,11 @@ async function Wc(e, t, n, r) {
|
|
|
9053
9041
|
text: o.text
|
|
9054
9042
|
};
|
|
9055
9043
|
}
|
|
9056
|
-
function
|
|
9057
|
-
let r =
|
|
9044
|
+
function Jc(e, t, n) {
|
|
9045
|
+
let r = Object.hasOwn(Wc, t.ext) ? t.ext : void 0;
|
|
9058
9046
|
if (t.ext === "xml") {
|
|
9059
|
-
let i =
|
|
9060
|
-
id:
|
|
9047
|
+
let i = $c(e, {
|
|
9048
|
+
id: Qc(e),
|
|
9061
9049
|
confidenceLevel: 1
|
|
9062
9050
|
}, n);
|
|
9063
9051
|
return {
|
|
@@ -9077,17 +9065,17 @@ function Gc(e, t, n) {
|
|
|
9077
9065
|
encodingConfidenceLevel: void 0,
|
|
9078
9066
|
encodingCandidates: void 0,
|
|
9079
9067
|
fileTypeConfig: t,
|
|
9080
|
-
text:
|
|
9068
|
+
text: Yc(e)
|
|
9081
9069
|
};
|
|
9082
9070
|
}
|
|
9083
|
-
function
|
|
9071
|
+
function Yc(e) {
|
|
9084
9072
|
return Array.from(new TextDecoder("windows-1252").decode(e), (e) => {
|
|
9085
9073
|
let t = e.codePointAt(0) ?? 0;
|
|
9086
9074
|
return t < 32 && e !== " " && e !== "\n" && e !== "\r" || t >= 127 && t <= 159 ? "·" : e;
|
|
9087
9075
|
}).join("");
|
|
9088
9076
|
}
|
|
9089
|
-
function
|
|
9090
|
-
let n =
|
|
9077
|
+
function Xc(e, t) {
|
|
9078
|
+
let n = Zc(e);
|
|
9091
9079
|
if (n != null) return [n];
|
|
9092
9080
|
let r = Oa(e, { minimumThreshold: 0 }), i = [];
|
|
9093
9081
|
for (let { confidence: e, encoding: t } of r) t != null && kc(t) && i.push({
|
|
@@ -9096,7 +9084,7 @@ function qc(e, t) {
|
|
|
9096
9084
|
});
|
|
9097
9085
|
return i.filter(({ confidenceLevel: e = 0 }, n) => n === 0 || e >= t);
|
|
9098
9086
|
}
|
|
9099
|
-
function
|
|
9087
|
+
function Zc(e) {
|
|
9100
9088
|
return e[0] === 239 && e[1] === 187 && e[2] === 191 ? {
|
|
9101
9089
|
confidenceLevel: 1,
|
|
9102
9090
|
id: "UTF-8-SIG"
|
|
@@ -9108,12 +9096,12 @@ function Jc(e) {
|
|
|
9108
9096
|
id: "utf-16-le"
|
|
9109
9097
|
} : void 0;
|
|
9110
9098
|
}
|
|
9111
|
-
function
|
|
9112
|
-
let t = new TextDecoder("ascii").decode(e.subarray(0,
|
|
9113
|
-
return
|
|
9099
|
+
function Qc(e) {
|
|
9100
|
+
let t = new TextDecoder("ascii").decode(e.subarray(0, Lc));
|
|
9101
|
+
return Zc(e)?.id ?? Rc.exec(t)?.[2] ?? "utf-8";
|
|
9114
9102
|
}
|
|
9115
|
-
function
|
|
9116
|
-
let r = n ? e :
|
|
9103
|
+
function $c(e, t, n) {
|
|
9104
|
+
let r = n ? e : pl(e);
|
|
9117
9105
|
try {
|
|
9118
9106
|
return {
|
|
9119
9107
|
encoding: t,
|
|
@@ -9121,29 +9109,33 @@ function Xc(e, t, n) {
|
|
|
9121
9109
|
};
|
|
9122
9110
|
} catch {
|
|
9123
9111
|
return {
|
|
9124
|
-
encoding:
|
|
9125
|
-
text: new TextDecoder(
|
|
9112
|
+
encoding: Ic,
|
|
9113
|
+
text: new TextDecoder(Ic.id, { fatal: !1 }).decode(r)
|
|
9126
9114
|
};
|
|
9127
9115
|
}
|
|
9128
9116
|
}
|
|
9129
|
-
function
|
|
9130
|
-
|
|
9117
|
+
function el(e, t) {
|
|
9118
|
+
let n = e?.split(";", 1)[0]?.trim().toLowerCase();
|
|
9119
|
+
return n != null && n !== "" && n !== Uc ? n === Hc : t != null && Vc.has(t);
|
|
9131
9120
|
}
|
|
9132
|
-
function
|
|
9121
|
+
function tl(e, t) {
|
|
9122
|
+
return nl(e) ? "json" : rl(e) ? "jsonl" : t ? "markdown" : "dtv";
|
|
9123
|
+
}
|
|
9124
|
+
function nl(e) {
|
|
9133
9125
|
let t = [], n = e.search(/\S/);
|
|
9134
9126
|
if (e[n] !== "{" && e[n] !== "[") return !1;
|
|
9135
9127
|
let r = {
|
|
9136
9128
|
expectation: "value",
|
|
9137
9129
|
index: n
|
|
9138
9130
|
};
|
|
9139
|
-
for (; r != null && r.index < e.length;) r =
|
|
9131
|
+
for (; r != null && r.index < e.length;) r = al(e, r, t);
|
|
9140
9132
|
return r != null;
|
|
9141
9133
|
}
|
|
9142
|
-
function
|
|
9134
|
+
function rl(e) {
|
|
9143
9135
|
let t = e.split(/\r\n|\n|\r/).filter((e) => e.trim() !== "");
|
|
9144
|
-
return t.length > 1 && t.every((e) =>
|
|
9136
|
+
return t.length > 1 && t.every((e) => il(e));
|
|
9145
9137
|
}
|
|
9146
|
-
function
|
|
9138
|
+
function il(e) {
|
|
9147
9139
|
try {
|
|
9148
9140
|
let t = JSON.parse(e);
|
|
9149
9141
|
return typeof t == "object" && !!t;
|
|
@@ -9151,15 +9143,15 @@ function el(e) {
|
|
|
9151
9143
|
return !1;
|
|
9152
9144
|
}
|
|
9153
9145
|
}
|
|
9154
|
-
function
|
|
9146
|
+
function al(e, { expectation: t, index: n }, r) {
|
|
9155
9147
|
let i = e.charAt(n);
|
|
9156
|
-
if (
|
|
9148
|
+
if (Bc.has(i)) return {
|
|
9157
9149
|
expectation: t,
|
|
9158
9150
|
index: n + 1
|
|
9159
9151
|
};
|
|
9160
9152
|
switch (t) {
|
|
9161
|
-
case "closeOrKey": return i === "}" ?
|
|
9162
|
-
case "closeOrValue": return i === "]" ?
|
|
9153
|
+
case "closeOrKey": return i === "}" ? ol(i, n, r) : sl(e, n);
|
|
9154
|
+
case "closeOrValue": return i === "]" ? ol(i, n, r) : cl(e, n, r);
|
|
9163
9155
|
case "colon": return i === ":" ? {
|
|
9164
9156
|
expectation: "value",
|
|
9165
9157
|
index: n + 1
|
|
@@ -9167,69 +9159,69 @@ function tl(e, { expectation: t, index: n }, r) {
|
|
|
9167
9159
|
case "commaOrClose": return i === "," ? {
|
|
9168
9160
|
expectation: r.at(-1) === "{" ? "key" : "value",
|
|
9169
9161
|
index: n + 1
|
|
9170
|
-
} :
|
|
9162
|
+
} : ol(i, n, r);
|
|
9171
9163
|
case "end": return;
|
|
9172
|
-
case "key": return
|
|
9173
|
-
case "value": return
|
|
9164
|
+
case "key": return sl(e, n);
|
|
9165
|
+
case "value": return cl(e, n, r);
|
|
9174
9166
|
}
|
|
9175
9167
|
}
|
|
9176
|
-
function
|
|
9168
|
+
function ol(e, t, n) {
|
|
9177
9169
|
if (e === (n.at(-1) === "{" ? "}" : "]")) return n.pop(), {
|
|
9178
9170
|
expectation: n.length === 0 ? "end" : "commaOrClose",
|
|
9179
9171
|
index: t + 1
|
|
9180
9172
|
};
|
|
9181
9173
|
}
|
|
9182
|
-
function
|
|
9183
|
-
let n = e.charAt(t) === "\"" ?
|
|
9174
|
+
function sl(e, t) {
|
|
9175
|
+
let n = e.charAt(t) === "\"" ? ll(e, t) : void 0;
|
|
9184
9176
|
return n == null ? void 0 : {
|
|
9185
9177
|
expectation: "colon",
|
|
9186
9178
|
index: n
|
|
9187
9179
|
};
|
|
9188
9180
|
}
|
|
9189
|
-
function
|
|
9181
|
+
function cl(e, t, n) {
|
|
9190
9182
|
let r = e.charAt(t);
|
|
9191
9183
|
if (r === "{" || r === "[") return n.push(r), {
|
|
9192
9184
|
expectation: r === "{" ? "closeOrKey" : "closeOrValue",
|
|
9193
9185
|
index: t + 1
|
|
9194
9186
|
};
|
|
9195
|
-
let i = r === "\"" ?
|
|
9187
|
+
let i = r === "\"" ? ll(e, t) : dl(e, t);
|
|
9196
9188
|
return i == null ? void 0 : {
|
|
9197
9189
|
expectation: "commaOrClose",
|
|
9198
9190
|
index: i
|
|
9199
9191
|
};
|
|
9200
9192
|
}
|
|
9201
|
-
function
|
|
9193
|
+
function ll(e, t) {
|
|
9202
9194
|
let n = t + 1;
|
|
9203
9195
|
for (; n < e.length;) {
|
|
9204
9196
|
let t = e.charAt(n);
|
|
9205
9197
|
if (t === "\"") return n + 1;
|
|
9206
9198
|
if (t < " ") return;
|
|
9207
9199
|
if (t === "\\") {
|
|
9208
|
-
let t =
|
|
9200
|
+
let t = ul(e, n);
|
|
9209
9201
|
if (t == null) return;
|
|
9210
9202
|
n = t;
|
|
9211
9203
|
} else n++;
|
|
9212
9204
|
}
|
|
9213
9205
|
return e.length;
|
|
9214
9206
|
}
|
|
9215
|
-
function
|
|
9207
|
+
function ul(e, t) {
|
|
9216
9208
|
let n = e.charAt(t + 1);
|
|
9217
9209
|
return n === "u" ? /^[\da-f]*$/i.test(e.slice(t + 2, t + 6)) ? t + 6 : void 0 : n === "" || String.raw`"\/bfnrt`.includes(n) ? t + 2 : void 0;
|
|
9218
9210
|
}
|
|
9219
|
-
function
|
|
9211
|
+
function dl(e, t) {
|
|
9220
9212
|
let n = /^[\w.+-]+/.exec(e.slice(t))?.[0];
|
|
9221
9213
|
if (n == null) return;
|
|
9222
9214
|
let r = t + n.length;
|
|
9223
|
-
return r === e.length ?
|
|
9215
|
+
return r === e.length ? zc.some((e) => e.startsWith(n)) || /^[\d.e+-]*$/i.test(n) ? r : void 0 : zc.includes(n) || fl(n) ? r : void 0;
|
|
9224
9216
|
}
|
|
9225
|
-
function
|
|
9217
|
+
function fl(e) {
|
|
9226
9218
|
try {
|
|
9227
9219
|
return typeof JSON.parse(e) == "number";
|
|
9228
9220
|
} catch {
|
|
9229
9221
|
return !1;
|
|
9230
9222
|
}
|
|
9231
9223
|
}
|
|
9232
|
-
function
|
|
9224
|
+
function pl(e) {
|
|
9233
9225
|
let t = e, n = t.length;
|
|
9234
9226
|
for (let e = n - 1; e >= 0; e--) {
|
|
9235
9227
|
let n = t[e];
|
|
@@ -9244,4 +9236,4 @@ function ll(e) {
|
|
|
9244
9236
|
}
|
|
9245
9237
|
return t;
|
|
9246
9238
|
}
|
|
9247
|
-
export {
|
|
9239
|
+
export { Gc as Tool };
|