@dpuse/dpuse-tool-file-previewer 0.0.60 → 0.0.62

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
@@ -89,9 +89,9 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
89
89
 
90
90
  |Chunk/Module/File|Composition|
91
91
  |:------ |:-----------|
92
- | dist/dpuse-tool-file-previewer.es.js | 164.1 kB · brotli 29.2 kB |
93
- |     chardet | `██████░░░░░░░░░░░░░░` 29.4% |
94
- |         lib/encoding/sbcs.js | `████░░░░░░░░░░░░░░░░` 20.1% |
92
+ | dist/dpuse-tool-file-previewer.es.js | 162.4 kB · brotli 29.0 kB |
93
+ |     chardet | `██████░░░░░░░░░░░░░░` 29.7% |
94
+ |         lib/encoding/sbcs.js | `████░░░░░░░░░░░░░░░░` 20.3% |
95
95
  |         lib/encoding/mbcs.js | `█░░░░░░░░░░░░░░░░░░░` 4.3% |
96
96
  |         lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 2.0% |
97
97
  |         lib/encoding/iso2022.js | `░░░░░░░░░░░░░░░░░░░░` 1.1% |
@@ -101,16 +101,16 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
101
101
  |         lib/utils.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
102
102
  |         lib/match.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
103
103
  |         lib/fs/browser.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
104
- |     file-type | `██████░░░░░░░░░░░░░░` 27.7% |
105
- |         source/index.js | `███░░░░░░░░░░░░░░░░░` 15.2% |
106
- |         source/detectors/zip.js | `█░░░░░░░░░░░░░░░░░░░` 6.5% |
107
- |         source/supported.js | `█░░░░░░░░░░░░░░░░░░░` 2.9% |
104
+ |     file-type | `██████░░░░░░░░░░░░░░` 28.0% |
105
+ |         source/index.js | `███░░░░░░░░░░░░░░░░░` 15.4% |
106
+ |         source/detectors/zip.js | `█░░░░░░░░░░░░░░░░░░░` 6.6% |
107
+ |         source/supported.js | `█░░░░░░░░░░░░░░░░░░░` 3.0% |
108
108
  |         source/detectors/asf.js | `░░░░░░░░░░░░░░░░░░░░` 0.8% |
109
109
  |         source/detectors/ebml.js | `░░░░░░░░░░░░░░░░░░░░` 0.7% |
110
110
  |         source/detectors/png.js | `░░░░░░░░░░░░░░░░░░░░` 0.6% |
111
111
  |         source/parser.js | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
112
112
  |         source/tokens.js | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
113
- |     (unassigned) → [unassigned] | `████░░░░░░░░░░░░░░░░` 20.4% |
113
+ |     (unassigned) → [unassigned] | `████░░░░░░░░░░░░░░░░` 20.5% |
114
114
  |     strtok3 | `█░░░░░░░░░░░░░░░░░░░` 4.3% |
115
115
  |         lib/ReadStreamTokenizer.js | `░░░░░░░░░░░░░░░░░░░░` 0.9% |
116
116
  |         lib/AbstractTokenizer.js | `░░░░░░░░░░░░░░░░░░░░` 0.9% |
@@ -123,18 +123,18 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
123
123
  |         lib/stream/Errors.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
124
124
  |         lib/stream/WebStreamReaderFactory.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
125
125
  |         lib/stream/WebStreamReader.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
126
- |     @dpuse/dpuse-shared | `█░░░░░░░░░░░░░░░░░░░` 4.3% |
127
- |         dist/dpuse-shared-encoding.es.js | `█░░░░░░░░░░░░░░░░░░░` 3.6% |
128
- |         dist/dpuse-shared-errors.es.js | `░░░░░░░░░░░░░░░░░░░░` 0.6% |
129
- |     @tokenizer/inflate | `█░░░░░░░░░░░░░░░░░░░` 3.9% |
126
+ |     @tokenizer/inflate | `█░░░░░░░░░░░░░░░░░░░` 4.0% |
130
127
  |         lib/ZipHandler.js | `█░░░░░░░░░░░░░░░░░░░` 3.0% |
131
128
  |         lib/ZipToken.js | `░░░░░░░░░░░░░░░░░░░░` 0.7% |
132
129
  |         lib/GzipHandler.js | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
130
+ |     @dpuse/dpuse-shared | `█░░░░░░░░░░░░░░░░░░░` 3.4% |
131
+ |         dist/dpuse-shared-encoding.es.js | `█░░░░░░░░░░░░░░░░░░░` 2.7% |
132
+ |         dist/dpuse-shared-errors.es.js | `░░░░░░░░░░░░░░░░░░░░` 0.7% |
133
133
  |     debug | `█░░░░░░░░░░░░░░░░░░░` 3.1% |
134
134
  |         src/browser.js | `░░░░░░░░░░░░░░░░░░░░` 1.6% |
135
135
  |         src/common.js | `░░░░░░░░░░░░░░░░░░░░` 1.5% |
136
136
  |     src → index.ts | `█░░░░░░░░░░░░░░░░░░░` 2.7% |
137
- |     @borewit/text-codec → lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 2.0% |
137
+ |     @borewit/text-codec → lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 2.1% |
138
138
  |     ms → index.js | `░░░░░░░░░░░░░░░░░░░░` 1.0% |
139
139
  |     token-types → lib/index.js | `░░░░░░░░░░░░░░░░░░░░` 0.6% |
140
140
  |     uint8array-extras → index.js | `░░░░░░░░░░░░░░░░░░░░` 0.6% |
@@ -8938,356 +8938,311 @@ function Qt(e) {
8938
8938
  function $t(e) {
8939
8939
  if (e != null && e !== "") return e.length > Jt ? `${e.slice(0, Jt)}... [truncated]` : e;
8940
8940
  }
8941
- //#endregion
8942
- //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-encoding.es.js
8943
8941
  var en = {
8944
8942
  ascii: {
8945
8943
  id: "ascii",
8946
- groupLabel: "",
8947
- label: "ascii",
8944
+ groupId: null,
8948
8945
  isDetectable: !1,
8949
8946
  isDecodable: !0
8950
8947
  },
8951
8948
  big5: {
8952
8949
  id: "big5",
8953
- groupLabel: "Chinese Traditional",
8954
- label: "Chinese Traditional (big5)",
8950
+ groupId: "chineseTraditional",
8955
8951
  isDetectable: !0,
8956
8952
  isDecodable: !0
8957
8953
  },
8958
8954
  "euc-jp": {
8959
8955
  id: "euc-jp",
8960
- groupLabel: "Japanese",
8961
- label: "Japanese (euc-jp)",
8956
+ groupId: "japanese",
8962
8957
  isDetectable: !0,
8963
8958
  isDecodable: !0
8964
8959
  },
8965
8960
  "euc-kr": {
8966
8961
  id: "euc-kr",
8967
- groupLabel: "Korean",
8968
- label: "Korean (euc-kr)",
8962
+ groupId: "korean",
8969
8963
  isDetectable: !0,
8970
8964
  isDecodable: !0
8971
8965
  },
8972
8966
  gb18030: {
8973
8967
  id: "gb18030",
8974
- groupLabel: "Chinese Simplified",
8975
- label: "Chinese Simplified (gb18030)",
8968
+ groupId: "chineseSimplified",
8976
8969
  isDetectable: !0,
8977
8970
  isDecodable: !0
8978
8971
  },
8979
8972
  gbk: {
8980
8973
  id: "gbk",
8981
- groupLabel: "Chinese Simplified",
8982
- label: "Chinese Simplified (gbk)",
8974
+ groupId: "chineseSimplified",
8983
8975
  isDetectable: !1,
8984
8976
  isDecodable: !0
8985
8977
  },
8986
8978
  ibm866: {
8987
8979
  id: "ibm866",
8988
- groupLabel: "Cyrillic",
8989
- label: "Cyrillic (ibm866)",
8980
+ groupId: "cyrillic",
8990
8981
  isDetectable: !1,
8991
8982
  isDecodable: !0
8992
8983
  },
8993
8984
  "iso-2022-cn": {
8994
8985
  id: "iso-2022-cn",
8995
- groupLabel: "Japanese",
8996
- label: "Japanese (iso-2022-cn)",
8986
+ groupId: "chineseSimplified",
8997
8987
  isDetectable: !0,
8998
8988
  isDecodable: !1
8999
8989
  },
9000
8990
  "iso-2022-jp": {
9001
8991
  id: "iso-2022-jp",
9002
- groupLabel: "Japanese",
9003
- label: "Japanese (iso-2022-jp)",
8992
+ groupId: "japanese",
9004
8993
  isDetectable: !0,
9005
8994
  isDecodable: !0
9006
8995
  },
9007
8996
  "iso-2022-kr": {
9008
8997
  id: "iso-2022-kr",
9009
- groupLabel: "Korean",
9010
- label: "Korean (iso-2022-kr)",
8998
+ groupId: "korean",
9011
8999
  isDetectable: !0,
9012
9000
  isDecodable: !1
9013
9001
  },
9014
9002
  "iso-8859-1": {
9015
9003
  id: "iso-8859-1",
9016
- groupLabel: "Western",
9017
- label: "Western (iso-8859-1)",
9004
+ groupId: "western",
9018
9005
  isDetectable: !0,
9019
9006
  isDecodable: !0
9020
9007
  },
9021
9008
  "iso-8859-2": {
9022
9009
  id: "iso-8859-2",
9023
- groupLabel: "Central European",
9024
- label: "Central European (iso-8859-2)",
9010
+ groupId: "centralEuropean",
9025
9011
  isDetectable: !0,
9026
9012
  isDecodable: !0
9027
9013
  },
9028
9014
  "iso-8859-3": {
9029
9015
  id: "iso-8859-3",
9030
- groupLabel: "Southern European",
9031
- label: "Southern European (iso-8859-3)",
9016
+ groupId: "southernEuropean",
9032
9017
  isDetectable: !1,
9033
9018
  isDecodable: !0
9034
9019
  },
9035
9020
  "iso-8859-4": {
9036
9021
  id: "iso-8859-4",
9037
- groupLabel: "Baltic",
9038
- label: "Baltic (iso-8859-4)",
9022
+ groupId: "baltic",
9039
9023
  isDetectable: !1,
9040
9024
  isDecodable: !0
9041
9025
  },
9042
9026
  "iso-8859-5": {
9043
9027
  id: "iso-8859-5",
9044
- groupLabel: "Cyrillic",
9045
- label: "Cyrillic (iso-8859-5)",
9028
+ groupId: "cyrillic",
9046
9029
  isDetectable: !0,
9047
9030
  isDecodable: !0
9048
9031
  },
9049
9032
  "iso-8859-6": {
9050
9033
  id: "iso-8859-6",
9051
- groupLabel: "Arabic",
9052
- label: "Arabic (iso-8859-6)",
9034
+ groupId: "arabic",
9053
9035
  isDetectable: !0,
9054
9036
  isDecodable: !0
9055
9037
  },
9056
9038
  "iso-8859-7": {
9057
9039
  id: "iso-8859-7",
9058
- groupLabel: "Greek",
9059
- label: "Greek (iso-8859-7)",
9040
+ groupId: "greek",
9060
9041
  isDetectable: !0,
9061
9042
  isDecodable: !0
9062
9043
  },
9063
9044
  "iso-8859-8": {
9064
9045
  id: "iso-8859-8",
9065
- groupLabel: "Hebrew",
9066
- label: "Hebrew (iso-8859-8)",
9046
+ groupId: "hebrew",
9067
9047
  isDetectable: !0,
9068
9048
  isDecodable: !0
9069
9049
  },
9070
9050
  "iso-8859-9": {
9071
9051
  id: "iso-8859-9",
9072
- groupLabel: "Turkish",
9073
- label: "Turkish (iso-8859-9)",
9052
+ groupId: "turkish",
9074
9053
  isDetectable: !0,
9075
9054
  isDecodable: !0
9076
9055
  },
9077
9056
  "iso-8859-10": {
9078
9057
  id: "iso-8859-10",
9079
- groupLabel: "Nordic",
9080
- label: "Nordic (iso-8859-10)",
9058
+ groupId: "nordic",
9081
9059
  isDetectable: !1,
9082
9060
  isDecodable: !0
9083
9061
  },
9084
9062
  "iso-8859-11": {
9085
9063
  id: "iso-8859-11",
9086
- groupLabel: "Thai",
9087
- label: "Thai (iso-8859-11)",
9064
+ groupId: "thai",
9088
9065
  isDetectable: !1,
9089
9066
  isDecodable: !0
9090
9067
  },
9091
9068
  "iso-8859-13": {
9092
9069
  id: "iso-8859-13",
9093
- groupLabel: "Baltic",
9094
- label: "Baltic (iso-8859-13)",
9070
+ groupId: "baltic",
9095
9071
  isDetectable: !1,
9096
9072
  isDecodable: !0
9097
9073
  },
9098
9074
  "iso-8859-14": {
9099
9075
  id: "iso-8859-14",
9100
- groupLabel: "Celtic",
9101
- label: "Celtic (iso-8859-14)",
9076
+ groupId: "celtic",
9102
9077
  isDetectable: !1,
9103
9078
  isDecodable: !0
9104
9079
  },
9105
9080
  "iso-8859-15": {
9106
9081
  id: "iso-8859-15",
9107
- groupLabel: "Western",
9108
- label: "Western (iso-8859-15)",
9082
+ groupId: "western",
9109
9083
  isDetectable: !1,
9110
9084
  isDecodable: !0
9111
9085
  },
9112
9086
  "iso-8859-16": {
9113
9087
  id: "iso-8859-16",
9114
- groupLabel: "Romanian",
9115
- label: "Romanian (iso-8859-16)",
9088
+ groupId: "romanian",
9116
9089
  isDetectable: !1,
9117
9090
  isDecodable: !0
9118
9091
  },
9119
- "kOi8-r": {
9092
+ "koi8-r": {
9120
9093
  id: "koi8-r",
9121
- groupLabel: "Cyrillic",
9122
- label: "Cyrillic (koi8-r)",
9094
+ groupId: "cyrillic",
9123
9095
  isDetectable: !0,
9124
9096
  isDecodable: !0
9125
9097
  },
9126
- "kOi8-u": {
9098
+ "koi8-u": {
9127
9099
  id: "koi8-u",
9128
- groupLabel: "Cyrillic",
9129
- label: "Cyrillic (koi8-u)",
9100
+ groupId: "cyrillic",
9130
9101
  isDetectable: !1,
9131
9102
  isDecodable: !0
9132
9103
  },
9133
9104
  latin1: {
9134
9105
  id: "latin1",
9135
- groupLabel: "Western",
9136
- label: "Western (latin1)",
9106
+ groupId: "western",
9137
9107
  isDetectable: !1,
9138
9108
  isDecodable: !0
9139
9109
  },
9140
9110
  macintosh: {
9141
9111
  id: "macintosh",
9142
- groupLabel: "Western",
9143
- label: "Western (macintosh)",
9112
+ groupId: "western",
9144
9113
  isDetectable: !1,
9145
9114
  isDecodable: !0
9146
9115
  },
9147
9116
  shift_jis: {
9148
9117
  id: "shift_jis",
9149
- groupLabel: "Japanese",
9150
- label: "Japanese (shift_jis)",
9118
+ groupId: "japanese",
9151
9119
  isDetectable: !0,
9152
9120
  isDecodable: !0
9153
9121
  },
9154
9122
  "tis-620": {
9155
9123
  id: "tis-620",
9156
- groupLabel: "Thai",
9157
- label: "Thai (tis-620)",
9124
+ groupId: "thai",
9158
9125
  isDetectable: !1,
9159
9126
  isDecodable: !0
9160
9127
  },
9161
- utf16: {
9162
- id: "utf16",
9163
- groupLabel: "Unicode 16",
9164
- label: "Unicode 16 (utf16)",
9128
+ "utf-16": {
9129
+ id: "utf-16",
9130
+ groupId: "unicode16",
9165
9131
  isDetectable: !1,
9166
9132
  isDecodable: !0
9167
9133
  },
9168
- utf16be: {
9169
- id: "utf16be",
9170
- groupLabel: "Unicode 16",
9171
- label: "Unicode 16 (utf16be)",
9134
+ "utf-16be": {
9135
+ id: "utf-16be",
9136
+ groupId: "unicode16",
9172
9137
  isDetectable: !0,
9173
9138
  isDecodable: !0
9174
9139
  },
9175
- utf16le: {
9176
- id: "utf16le",
9177
- groupLabel: "Unicode 16",
9178
- label: "Unicode 16 (utf16le)",
9140
+ "utf-16le": {
9141
+ id: "utf-16le",
9142
+ groupId: "unicode16",
9179
9143
  isDetectable: !0,
9180
9144
  isDecodable: !0
9181
9145
  },
9182
- utf32be: {
9183
- id: "utf32be",
9184
- groupLabel: "Unicode 32",
9185
- label: "Unicode 32 (utf32be)",
9146
+ "utf-32be": {
9147
+ id: "utf-32be",
9148
+ groupId: "unicode32",
9186
9149
  isDetectable: !0,
9187
9150
  isDecodable: !1
9188
9151
  },
9189
- utf32le: {
9190
- id: "utf32le",
9191
- groupLabel: "Unicode 32",
9192
- label: "Unicode 32 (utf32le)",
9152
+ "utf-32le": {
9153
+ id: "utf-32le",
9154
+ groupId: "unicode32",
9193
9155
  isDetectable: !0,
9194
9156
  isDecodable: !1
9195
9157
  },
9196
- utf8: {
9197
- id: "utf8",
9198
- groupLabel: "",
9199
- label: "utf8",
9158
+ "utf-8": {
9159
+ id: "utf-8",
9160
+ groupId: null,
9200
9161
  isDetectable: !0,
9201
9162
  isDecodable: !0
9202
9163
  },
9203
9164
  "windows-1250": {
9204
9165
  id: "windows-1250",
9205
- groupLabel: "Central European",
9206
- label: "Central European (windows-1250)",
9166
+ groupId: "centralEuropean",
9207
9167
  isDetectable: !0,
9208
9168
  isDecodable: !0
9209
9169
  },
9210
9170
  "windows-1251": {
9211
9171
  id: "windows-1251",
9212
- groupLabel: "Cyrillic",
9213
- label: "Cyrillic (windows-1251)",
9172
+ groupId: "cyrillic",
9214
9173
  isDetectable: !0,
9215
9174
  isDecodable: !0
9216
9175
  },
9217
9176
  "windows-1252": {
9218
9177
  id: "windows-1252",
9219
- groupLabel: "Western",
9220
- label: "Western (windows-1252)",
9178
+ groupId: "western",
9221
9179
  isDetectable: !0,
9222
9180
  isDecodable: !0
9223
9181
  },
9224
9182
  "windows-1253": {
9225
9183
  id: "windows-1253",
9226
- groupLabel: "Greek",
9227
- label: "Greek (windows-1253)",
9184
+ groupId: "greek",
9228
9185
  isDetectable: !0,
9229
9186
  isDecodable: !0
9230
9187
  },
9231
9188
  "windows-1254": {
9232
9189
  id: "windows-1254",
9233
- groupLabel: "Turkish",
9234
- label: "Turkish (windows-1254)",
9190
+ groupId: "turkish",
9235
9191
  isDetectable: !0,
9236
9192
  isDecodable: !0
9237
9193
  },
9238
9194
  "windows-1255": {
9239
9195
  id: "windows-1255",
9240
- groupLabel: "Hebrew",
9241
- label: "Hebrew (windows-1255)",
9196
+ groupId: "hebrew",
9242
9197
  isDetectable: !0,
9243
9198
  isDecodable: !0
9244
9199
  },
9245
9200
  "windows-1256": {
9246
9201
  id: "windows-1256",
9247
- groupLabel: "Arabic",
9248
- label: "Arabic (windows-1256)",
9202
+ groupId: "arabic",
9249
9203
  isDetectable: !0,
9250
9204
  isDecodable: !0
9251
9205
  },
9252
9206
  "windows-1257": {
9253
9207
  id: "windows-1257",
9254
- groupLabel: "Baltic",
9255
- label: "Baltic (windows-1257)",
9208
+ groupId: "baltic",
9256
9209
  isDetectable: !1,
9257
9210
  isDecodable: !0
9258
9211
  },
9259
9212
  "windows-1258": {
9260
9213
  id: "windows-1258",
9261
- groupLabel: "Vietnamese",
9262
- label: "Vietnamese (windows-1258)",
9214
+ groupId: "vietnamese",
9263
9215
  isDetectable: !1,
9264
9216
  isDecodable: !0
9265
9217
  },
9266
9218
  "windows-874": {
9267
9219
  id: "windows-874",
9268
- groupLabel: "Thai",
9269
- label: "Thai (windows-874)",
9220
+ groupId: "thai",
9270
9221
  isDetectable: !1,
9271
9222
  isDecodable: !0
9272
9223
  },
9273
9224
  "x-mac-cyrillic": {
9274
9225
  id: "x-mac-cyrillic",
9275
- groupLabel: "Cyrillic",
9276
- label: "Cyrillic (x-mac-cyrillic)",
9226
+ groupId: "cyrillic",
9277
9227
  isDetectable: !1,
9278
9228
  isDecodable: !0
9279
9229
  },
9280
9230
  "x-user-defined": {
9281
9231
  id: "x-user-defined",
9282
- groupLabel: "Other",
9283
- label: "Other (x-user-defined)",
9232
+ groupId: "other",
9284
9233
  isDetectable: !1,
9285
9234
  isDecodable: !0
9286
9235
  }
9287
- }, tn = {
9288
- id: "utf8",
9236
+ };
9237
+ function tn(e) {
9238
+ return Object.hasOwn(en, e);
9239
+ }
9240
+ //#endregion
9241
+ //#region src/index.ts
9242
+ var nn = {
9243
+ id: "utf-8",
9289
9244
  confidenceLevel: void 0
9290
- }, nn = {
9245
+ }, rn = {
9291
9246
  arrow: {
9292
9247
  label: "Columnar format for tables of data.",
9293
9248
  isAutoDetectable: !0,
@@ -9452,17 +9407,17 @@ var en = {
9452
9407
  isSupported: !1,
9453
9408
  notes: ""
9454
9409
  }
9455
- }, rn = class {
9410
+ }, an = class {
9456
9411
  async previewFile(e, t, n) {
9457
9412
  let r = await fetch(encodeURI(e), {
9458
9413
  headers: { Range: `bytes=0-${String(n ?? 4095)}` },
9459
9414
  signal: t
9460
9415
  });
9461
9416
  if (!r.ok) throw await Zt(r, `Failed to fetch '${e}' file.`, "dpuse-tool-file-previewer.previewRemoteFile");
9462
- return await an(new Uint8Array(await r.arrayBuffer()));
9417
+ return await on(new Uint8Array(await r.arrayBuffer()));
9463
9418
  }
9464
9419
  };
9465
- async function an(e) {
9420
+ async function on(e) {
9466
9421
  if (e.length === 0) return {
9467
9422
  bytes: e,
9468
9423
  dataFormatId: void 0,
@@ -9473,17 +9428,17 @@ async function an(e) {
9473
9428
  };
9474
9429
  let t = await Kt(e);
9475
9430
  if (t == null) {
9476
- let n = sn(e, on(e));
9431
+ let n = cn(e, sn(e));
9477
9432
  return {
9478
9433
  bytes: e,
9479
- dataFormatId: cn(n.text) ? "json" : "dtv",
9434
+ dataFormatId: ln(n.text) ? "json" : "dtv",
9480
9435
  encodingId: n.encoding.id,
9481
9436
  encodingConfidenceLevel: n.encoding.confidenceLevel,
9482
9437
  fileTypeConfig: t,
9483
9438
  text: n.text
9484
9439
  };
9485
9440
  }
9486
- let n = nn[t.ext];
9441
+ let n = rn[t.ext];
9487
9442
  return n == null ? {
9488
9443
  bytes: e,
9489
9444
  dataFormatId: void 0,
@@ -9500,10 +9455,10 @@ async function an(e) {
9500
9455
  text: void 0
9501
9456
  };
9502
9457
  }
9503
- function on(e) {
9458
+ function sn(e) {
9504
9459
  if (e[0] === 239 && e[1] === 187 && e[2] === 191) return {
9505
9460
  confidenceLevel: 100,
9506
- id: "utf8"
9461
+ id: "utf-8"
9507
9462
  };
9508
9463
  if (e[0] === 254 && e[1] === 255) return {
9509
9464
  confidenceLevel: 100,
@@ -9515,27 +9470,27 @@ function on(e) {
9515
9470
  };
9516
9471
  let t = f.default.analyse(e)[0] ?? {
9517
9472
  confidence: void 0,
9518
- name: "utf8"
9519
- }, n = en[t.name.toLowerCase()], r = n == null ? "utf8" : n.id;
9473
+ name: "utf-8"
9474
+ }, n = t.name.toLowerCase();
9520
9475
  return {
9521
9476
  confidenceLevel: t.confidence,
9522
- id: r
9477
+ id: tn(n) ? n : "utf-8"
9523
9478
  };
9524
9479
  }
9525
- function sn(e, t) {
9480
+ function cn(e, t) {
9526
9481
  try {
9527
9482
  return {
9528
9483
  encoding: t,
9529
- text: new TextDecoder(t.id).decode(ln(e))
9484
+ text: new TextDecoder(t.id).decode(un(e))
9530
9485
  };
9531
9486
  } catch {
9532
9487
  return {
9533
- encoding: tn,
9534
- text: new TextDecoder(tn.id, { fatal: !1 }).decode(ln(e))
9488
+ encoding: nn,
9489
+ text: new TextDecoder(nn.id, { fatal: !1 }).decode(un(e))
9535
9490
  };
9536
9491
  }
9537
9492
  }
9538
- function cn(e) {
9493
+ function ln(e) {
9539
9494
  let t = e.trimStart();
9540
9495
  if (t.length > 2) {
9541
9496
  let e = t[0], n = e === "{", r = e === "[", i = /"\s*:\s*/.test(t), a = /\b(?:true|false|null)\b/.test(t), o = t.includes("\"");
@@ -9543,7 +9498,7 @@ function cn(e) {
9543
9498
  }
9544
9499
  return !1;
9545
9500
  }
9546
- function ln(e) {
9501
+ function un(e) {
9547
9502
  let t = e, n = t.length;
9548
9503
  for (let e = n - 1; e >= 0; e--) {
9549
9504
  let n = t[e];
@@ -9559,4 +9514,4 @@ function ln(e) {
9559
9514
  return t;
9560
9515
  }
9561
9516
  //#endregion
9562
- export { rn as Tool };
9517
+ export { an as Tool };