@depup/file-type 22.1.0-depup.0 → 22.1.1-depup.1
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 +9 -3
- package/changes.json +8 -3
- package/package.json +11 -6
- package/readme.md +2 -0
- package/source/detectors/zip.js +9 -4
package/README.md
CHANGED
|
@@ -13,10 +13,16 @@ npm install @depup/file-type
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [file-type](https://www.npmjs.com/package/file-type) @ 22.1.
|
|
17
|
-
| Processed | 2026-09-
|
|
16
|
+
| Original | [file-type](https://www.npmjs.com/package/file-type) @ 22.1.1 |
|
|
17
|
+
| Processed | 2026-09-27 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 1 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| uint8array-extras | ^1.5.0 | ^1.6.0 |
|
|
20
26
|
|
|
21
27
|
---
|
|
22
28
|
|
package/changes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/file-type",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.1-depup.1",
|
|
4
4
|
"description": "Detect the file type of a file, stream, or data (with updated dependencies)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/file-type",
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
"@tokenizer/inflate": "^0.4.1",
|
|
244
244
|
"strtok3": "^10.3.5",
|
|
245
245
|
"token-types": "^6.1.2",
|
|
246
|
-
"uint8array-extras": "^1.
|
|
246
|
+
"uint8array-extras": "^1.6.0"
|
|
247
247
|
},
|
|
248
248
|
"devDependencies": {
|
|
249
249
|
"@tokenizer/token": "^0.3.0",
|
|
@@ -281,11 +281,16 @@
|
|
|
281
281
|
"serial": true
|
|
282
282
|
},
|
|
283
283
|
"depup": {
|
|
284
|
-
"changes": {
|
|
285
|
-
|
|
284
|
+
"changes": {
|
|
285
|
+
"uint8array-extras": {
|
|
286
|
+
"from": "^1.5.0",
|
|
287
|
+
"to": "^1.6.0"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"depsUpdated": 1,
|
|
286
291
|
"originalPackage": "file-type",
|
|
287
|
-
"originalVersion": "22.1.
|
|
288
|
-
"processedAt": "2026-09-
|
|
292
|
+
"originalVersion": "22.1.1",
|
|
293
|
+
"processedAt": "2026-09-27T01:08:12.512Z",
|
|
289
294
|
"smokeTest": "passed"
|
|
290
295
|
}
|
|
291
296
|
}
|
package/readme.md
CHANGED
|
@@ -581,6 +581,8 @@ MIME media subtypes prefixed with `x-ft-` are custom and defined by us. They are
|
|
|
581
581
|
|
|
582
582
|
ISO 9660 requires random-access input or `fileTypeStream()` with `sampleSize >= 32_774`; `fileTypeFromStream()` is unsupported.
|
|
583
583
|
|
|
584
|
+
When `[Content_Types].xml` cannot be reached — it may trail the content entries, and only so much of what precedes it is scanned — the type is guessed from the archive's directory names: `word/`, `xl/` and `ppt/` are reported as `docx`, `xlsx` and `pptx`. Macro-enabled and template variants are therefore reported as their base type, and a non-OOXML archive containing one of those directories is reported as OOXML.
|
|
585
|
+
|
|
584
586
|
*[Pull requests](.github/pull_request_template.md) are welcome for additional commonly used file types.*
|
|
585
587
|
|
|
586
588
|
The following file types will not be accepted, but most of them are supported by [third-party detectors](#available-third-party-file-type-detectors).
|
package/source/detectors/zip.js
CHANGED
|
@@ -392,7 +392,7 @@ async function readZipDataDescriptorEntryWithLimit(zipHandler, {shouldBuffer, ma
|
|
|
392
392
|
|
|
393
393
|
bytesConsumed += chunkLength;
|
|
394
394
|
if (bytesConsumed > maximumLength) {
|
|
395
|
-
throw new
|
|
395
|
+
throw new ParserHardLimitError(`ZIP entry data descriptor not found within ${maximumLength} bytes`);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
if (shouldBuffer) {
|
|
@@ -626,9 +626,14 @@ export async function detectZip(tokenizer) {
|
|
|
626
626
|
openXmlState.hasUnparseableContentTypes = true;
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
-
//
|
|
630
|
-
//
|
|
631
|
-
|
|
629
|
+
// Producers are free to put [Content_Types].xml after the content entries, so running out of
|
|
630
|
+
// input or budget before reaching it says nothing about whether this is an OOXML file.
|
|
631
|
+
// Guess from the directory names instead.
|
|
632
|
+
if (
|
|
633
|
+
!fileType
|
|
634
|
+
&& (error instanceof strtok3.EndOfStreamError || error instanceof ParserHardLimitError)
|
|
635
|
+
&& !openXmlState.hasContentTypesEntry
|
|
636
|
+
) {
|
|
632
637
|
fileType = getOpenXmlFileTypeFromDirectoryNames(openXmlState);
|
|
633
638
|
}
|
|
634
639
|
}
|