@dpuse/dpuse-tool-file-previewer 1.0.134 → 1.0.136

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
@@ -62,7 +62,7 @@ License data is updated each time `npm run document` is run, using [license-chec
62
62
  | Dependency | Version | License(s) | Document |
63
63
  | :--------------------------------------------------------------------- | :-----: | :--------- | :-------------------------------------------------------------------- |
64
64
  | [@borewit/text-codec](https://github.com/Borewit/text-codec) | 0.2.3 | MIT | [LICENSE](licenses/downloads/@borewit/text-codec@0.2.3-LICENSE.txt) |
65
- | [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.209 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.209-LICENSE.txt) |
65
+ | [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.211 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.211-LICENSE.txt) |
66
66
  | [@tokenizer/inflate](https://github.com/Borewit/tokenizer-inflate) | 0.6.0 | MIT | [LICENSE](licenses/downloads/@tokenizer/inflate@0.6.0-LICENSE.txt) |
67
67
  | [debug](https://github.com/debug-js/debug) | 4.4.3 | MIT | [LICENSE](licenses/downloads/debug@4.4.3-LICENSE.txt) |
68
68
  | [file-type](https://github.com/sindresorhus/file-type) | 22.3.0 | MIT | [LICENSE](licenses/downloads/file-type@22.3.0-LICENSE.txt) |
@@ -77,7 +77,7 @@ License data is updated each time `npm run document` is run, using [license-chec
77
77
 
78
78
  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.
79
79
 
80
- - **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.209 — this month: 2026-11-11
80
+ - **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.211 — this month: 2026-11-11
81
81
  - **[file-type](https://github.com/sindresorhus/file-type)** 22.3.0 — this month: 2026-10-29
82
82
  - **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 2 mths ago: 2026-09-09
83
83
  - **[file-type](https://github.com/sindresorhus/file-type)** 22.3.0 — this month: 2026-10-29
@@ -103,7 +103,7 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
103
103
 
104
104
  | Chunk/Module/File | Composition |
105
105
  | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ |
106
- | **dist/dpuse-tool-file-previewer.es.js** | 1263.9 kB · gzip 724.5 kB · 100.0% of the build |
106
+ | **dist/dpuse-tool-file-previewer.es.js** | 1263.6 kB · gzip 724.5 kB · 100.0% of the build |
107
107
  |     jschardet → dist/jschardet.esm.min.js | `██████████████████░░` 89.6% · 1132.0 kB |
108
108
  |     file-type → source/index.js + 7 more | `█░░░░░░░░░░░░░░░░░░░` 3.4% · 42.9 kB |
109
109
  |         ↳ 8 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 3.4% · 42.9 kB |
@@ -112,8 +112,8 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
112
112
  |         ↳ 16 smaller files | `░░░░░░░░░░░░░░░░░░░░` 1.1% · 13.8 kB |
113
113
  |     @tokenizer/inflate → lib/ZipHandler.js + 3 more | `░░░░░░░░░░░░░░░░░░░░` 0.8% · 10.2 kB |
114
114
  |         ↳ 4 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.8% · 10.2 kB |
115
- |     src → index.ts + 2 more | `░░░░░░░░░░░░░░░░░░░░` 0.6% · 8.0 kB |
116
- |         ↳ 3 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.6% · 8.0 kB |
115
+ |     src → index.ts + 2 more | `░░░░░░░░░░░░░░░░░░░░` 0.6% · 7.7 kB |
116
+ |         ↳ 3 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.6% · 7.7 kB |
117
117
  |     debug → src/browser.js + 1 more | `░░░░░░░░░░░░░░░░░░░░` 0.4% · 5.1 kB |
118
118
  |         ↳ 2 smaller files | `░░░░░░░░░░░░░░░░░░░░` 0.4% · 5.1 kB |
119
119
  |     @borewit/text-codec → lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 0.4% · 4.9 kB |
@@ -3719,7 +3719,6 @@ var zn = {
3719
3719
  "previewObject",
3720
3720
  "queryRecords",
3721
3721
  "removeRecords",
3722
- "retrieveChunks",
3723
3722
  "retrieveRecords",
3724
3723
  "upsertRecords"
3725
3724
  ]), F([
@@ -9747,12 +9746,11 @@ function ml(e) {
9747
9746
  };
9748
9747
  }
9749
9748
  function hl(e, t, n) {
9750
- let r = !bl(t.id), i = r ? dl : t, a = new TextDecoder(Hn(i.id)).decode(e, { stream: !n }), o = n ? a : xl(a);
9749
+ let r = bl(t.id) ? t : dl, i = new TextDecoder(Hn(r.id)).decode(e, { stream: !n }), a = n ? i : xl(i);
9751
9750
  return {
9752
- encoding: i,
9753
- isFallback: r,
9754
- replacementCharacterCount: Sl(o),
9755
- text: o
9751
+ encoding: r,
9752
+ replacementCharacterCount: Sl(a),
9753
+ text: a
9756
9754
  };
9757
9755
  }
9758
9756
  function gl(e) {
@@ -9926,20 +9924,14 @@ var Il = 65536, Ll = {
9926
9924
  xml: "xml"
9927
9925
  }, Rl = /* @__PURE__ */ new Set(["markdown", "md"]), zl = class {
9928
9926
  async previewFile(e, t, n, r, i) {
9929
- let a = ql(r, Yn(new URL(e).pathname)?.toLowerCase()), o = n ?? Il, s = await fetch(encodeURI(e), {
9927
+ let a = Kl(r, Yn(new URL(e).pathname)?.toLowerCase()), o = n ?? Il, s = await fetch(encodeURI(e), {
9930
9928
  headers: { Range: `bytes=0-${String(o - 1)}` },
9931
9929
  signal: t
9932
9930
  });
9933
- if (s.status === 416) return {
9934
- ...await Hl(/* @__PURE__ */ new Uint8Array(), a, !0),
9935
- isComplete: !0
9936
- };
9931
+ if (s.status === 416) return Vl(/* @__PURE__ */ new Uint8Array(), a, !0);
9937
9932
  if (!s.ok) throw await Kn(s, `Failed to fetch '${e}' file.`, "dpuse-tool-file-previewer.Tool.previewFile");
9938
- let { fileBytes: c, isCutShort: l } = await Bl(s, o), u = !l && Vl(s, c.length, o);
9939
- return {
9940
- ...await Hl(c, a, u, i),
9941
- isComplete: u
9942
- };
9933
+ let { fileBytes: c, isCutShort: l } = await Bl(s, o);
9934
+ return Vl(c, a, !l && Gl(s, c.length, o), i);
9943
9935
  }
9944
9936
  };
9945
9937
  async function Bl(e, t) {
@@ -9958,89 +9950,89 @@ async function Bl(e, t) {
9958
9950
  isCutShort: a
9959
9951
  };
9960
9952
  }
9961
- function Vl(e, t, n) {
9962
- let r = /\/(\d+)$/.exec(e.headers.get("content-range") ?? "")?.[1];
9963
- return r == null ? e.status !== 206 || t < n : t >= Number(r);
9964
- }
9965
- async function Hl(e, t, n, r) {
9953
+ async function Vl(e, t, n, r) {
9966
9954
  if (e.length === 0) return {
9967
9955
  bytes: e,
9968
9956
  dataFormatId: void 0,
9969
9957
  dataFormatSourceId: void 0,
9958
+ decodedEncodingId: void 0,
9970
9959
  encodingId: void 0,
9971
9960
  encodingConfidenceLevel: void 0,
9972
9961
  encodingSourceId: void 0,
9973
9962
  encodingCandidates: void 0,
9974
9963
  replacementCharacterCount: void 0,
9975
9964
  fileTypeConfig: void 0,
9965
+ isComplete: n,
9976
9966
  text: void 0
9977
9967
  };
9978
9968
  let i = await _n(e);
9979
- if (i != null) return Ul(e, i, n, r);
9980
- let a = pl(e, n), o = Wl(r), s = hl(e, o ?? a.encoding, n);
9969
+ if (i != null) return Hl(e, i, n, r);
9970
+ let a = pl(e, n), o = hl(e, Ul(r) ?? a.encoding, n);
9981
9971
  return {
9982
9972
  bytes: e,
9983
- ...Kl(r, Jl(s.text, t)),
9984
- encodingId: s.encoding.id,
9985
- encodingConfidenceLevel: s.encoding.confidenceLevel,
9986
- encodingSourceId: Gl(s, o, a.sourceId),
9973
+ ...ql(o.text, t),
9974
+ ...Wl(a, o),
9987
9975
  encodingCandidates: a.candidates,
9988
- replacementCharacterCount: s.replacementCharacterCount,
9989
9976
  fileTypeConfig: i,
9990
- text: s.text
9977
+ isComplete: n,
9978
+ text: o.text
9991
9979
  };
9992
9980
  }
9993
- function Ul(e, t, n, r) {
9994
- let i = Object.hasOwn(Ll, t.ext) ? Ll[t.ext] : void 0, a = Kl(r, {
9981
+ function Hl(e, t, n, r) {
9982
+ let i = Object.hasOwn(Ll, t.ext) ? Ll[t.ext] : void 0, a = {
9995
9983
  dataFormatId: i,
9996
9984
  dataFormatSourceId: i == null ? void 0 : "fileContent"
9997
- });
9985
+ };
9998
9986
  if (t.ext === "xml") {
9999
- let i = ml(e), o = Wl(r), s = hl(e, o ?? i.encoding, n);
9987
+ let i = ml(e), o = hl(e, Ul(r) ?? i.encoding, n);
10000
9988
  return {
10001
9989
  bytes: e,
10002
9990
  ...a,
10003
- encodingId: s.encoding.id,
10004
- encodingConfidenceLevel: s.encoding.confidenceLevel,
10005
- encodingSourceId: Gl(s, o, i.sourceId),
9991
+ ...Wl(i, o),
10006
9992
  encodingCandidates: void 0,
10007
- replacementCharacterCount: s.replacementCharacterCount,
10008
9993
  fileTypeConfig: t,
10009
- text: s.text
9994
+ isComplete: n,
9995
+ text: o.text
10010
9996
  };
10011
9997
  }
10012
9998
  return {
10013
9999
  bytes: e,
10014
10000
  ...a,
10001
+ decodedEncodingId: void 0,
10015
10002
  encodingId: void 0,
10016
10003
  encodingConfidenceLevel: void 0,
10017
10004
  encodingSourceId: void 0,
10018
10005
  encodingCandidates: void 0,
10019
10006
  replacementCharacterCount: void 0,
10020
10007
  fileTypeConfig: t,
10008
+ isComplete: n,
10021
10009
  text: gl(e)
10022
10010
  };
10023
10011
  }
10024
- function Wl(e) {
10025
- return e?.encodingId == null ? void 0 : {
10026
- id: e.encodingId,
10012
+ function Ul(e) {
10013
+ return e == null ? void 0 : {
10014
+ id: e,
10027
10015
  confidenceLevel: 1
10028
10016
  };
10029
10017
  }
10018
+ function Wl(e, t) {
10019
+ return {
10020
+ decodedEncodingId: t.encoding.id,
10021
+ encodingId: e.encoding.id,
10022
+ encodingConfidenceLevel: e.encoding.confidenceLevel,
10023
+ encodingSourceId: e.sourceId,
10024
+ replacementCharacterCount: t.replacementCharacterCount
10025
+ };
10026
+ }
10030
10027
  function Gl(e, t, n) {
10031
- return e.isFallback ? "fallback" : t == null ? n : "choice";
10028
+ let r = /\/(\d+)$/.exec(e.headers.get("content-range") ?? "")?.[1];
10029
+ return r == null ? e.status !== 206 || t < n : t >= Number(r);
10032
10030
  }
10033
10031
  function Kl(e, t) {
10034
- return e?.dataFormatId == null ? t : {
10035
- dataFormatId: e.dataFormatId,
10036
- dataFormatSourceId: "choice"
10037
- };
10038
- }
10039
- function ql(e, t) {
10040
10032
  let n = e?.split(";", 1)[0]?.trim().toLowerCase();
10041
10033
  return n != null && n !== "" && n !== "application/octet-stream" ? n === "text/markdown" ? "mimeType" : void 0 : t != null && Rl.has(t) ? "extension" : void 0;
10042
10034
  }
10043
- function Jl(e, t) {
10035
+ function ql(e, t) {
10044
10036
  return Tl(e) ? {
10045
10037
  dataFormatId: "json",
10046
10038
  dataFormatSourceId: "jsonSyntax"