@depup/file-type 22.0.2-depup.0 → 22.1.0-depup.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/README.md +2 -2
- package/changes.json +1 -1
- package/package.json +5 -4
- package/readme.md +3 -0
- package/source/index.js +28 -1
- package/source/supported.js +2 -0
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ 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.0
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [file-type](https://www.npmjs.com/package/file-type) @ 22.1.0 |
|
|
17
|
+
| Processed | 2026-09-11 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/file-type",
|
|
3
|
-
"version": "22.0
|
|
3
|
+
"version": "22.1.0-depup.0",
|
|
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",
|
|
@@ -236,7 +236,8 @@
|
|
|
236
236
|
"dat",
|
|
237
237
|
"key",
|
|
238
238
|
"numbers",
|
|
239
|
-
"pages"
|
|
239
|
+
"pages",
|
|
240
|
+
"iso"
|
|
240
241
|
],
|
|
241
242
|
"dependencies": {
|
|
242
243
|
"@tokenizer/inflate": "^0.4.1",
|
|
@@ -283,8 +284,8 @@
|
|
|
283
284
|
"changes": {},
|
|
284
285
|
"depsUpdated": 0,
|
|
285
286
|
"originalPackage": "file-type",
|
|
286
|
-
"originalVersion": "22.0
|
|
287
|
-
"processedAt": "2026-
|
|
287
|
+
"originalVersion": "22.1.0",
|
|
288
|
+
"processedAt": "2026-09-11T16:12:10.970Z",
|
|
288
289
|
"smokeTest": "passed"
|
|
289
290
|
}
|
|
290
291
|
}
|
package/readme.md
CHANGED
|
@@ -464,6 +464,7 @@ MIME media subtypes prefixed with `x-ft-` are custom and defined by us. They are
|
|
|
464
464
|
- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
|
|
465
465
|
- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
|
|
466
466
|
- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
|
|
467
|
+
- [`iso`](https://en.wikipedia.org/wiki/ISO_9660) - ISO 9660 disc image
|
|
467
468
|
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
|
|
468
469
|
- [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
469
470
|
- [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
|
|
@@ -578,6 +579,8 @@ MIME media subtypes prefixed with `x-ft-` are custom and defined by us. They are
|
|
|
578
579
|
- [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format)) - Archive file
|
|
579
580
|
- [`zst`](https://en.wikipedia.org/wiki/Zstandard) - Archive file
|
|
580
581
|
|
|
582
|
+
ISO 9660 requires random-access input or `fileTypeStream()` with `sampleSize >= 32_774`; `fileTypeFromStream()` is unsupported.
|
|
583
|
+
|
|
581
584
|
*[Pull requests](.github/pull_request_template.md) are welcome for additional commonly used file types.*
|
|
582
585
|
|
|
583
586
|
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/index.js
CHANGED
|
@@ -64,7 +64,7 @@ function getKnownFileSizeOrMaximum(fileSize) {
|
|
|
64
64
|
|
|
65
65
|
// Keep the specifier non-literal at the call site so browser bundlers do not try to resolve Node-only imports.
|
|
66
66
|
function importAtRuntime(specifier) {
|
|
67
|
-
return import(specifier);
|
|
67
|
+
return import(/* @vite-ignore */ /* webpackIgnore: true */ specifier);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Wrap stream in an identity TransformStream to avoid BYOB readers.
|
|
@@ -1689,6 +1689,33 @@ export class FileTypeParser {
|
|
|
1689
1689
|
mime: 'application/pgp-encrypted',
|
|
1690
1690
|
};
|
|
1691
1691
|
}
|
|
1692
|
+
|
|
1693
|
+
// ISO 9660 optical disc image: the Volume Descriptor Set starts at sector 16 (2048-byte
|
|
1694
|
+
// sectors). Every descriptor in that set carries the 5-byte standard identifier `CD001`
|
|
1695
|
+
// at offset 1, regardless of descriptor type, so checking the first one is sufficient.
|
|
1696
|
+
// Only attempted for random-access inputs (buffer/file/blob, or a stream sampled with a
|
|
1697
|
+
// large enough `sampleSize`): on an unknown-size stream this offset is far past what's
|
|
1698
|
+
// reasonable to buffer just to rule out one format, so it's left undetected there.
|
|
1699
|
+
const isoStandardIdentifierOffset = 32_769;
|
|
1700
|
+
const isoStandardIdentifierLength = 5;
|
|
1701
|
+
if (
|
|
1702
|
+
tokenizer.supportsRandomAccess()
|
|
1703
|
+
&& tokenizer.fileInfo.size >= (isoStandardIdentifierOffset + isoStandardIdentifierLength)
|
|
1704
|
+
) {
|
|
1705
|
+
const isoStandardIdentifier = new Uint8Array(isoStandardIdentifierLength);
|
|
1706
|
+
await tokenizer.peekBuffer(isoStandardIdentifier, {
|
|
1707
|
+
position: isoStandardIdentifierOffset,
|
|
1708
|
+
length: isoStandardIdentifierLength,
|
|
1709
|
+
mayBeLess: true,
|
|
1710
|
+
});
|
|
1711
|
+
|
|
1712
|
+
if (checkBytes(isoStandardIdentifier, stringToBytes('CD001'))) {
|
|
1713
|
+
return {
|
|
1714
|
+
ext: 'iso',
|
|
1715
|
+
mime: 'application/x-iso9660-image',
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1692
1719
|
};
|
|
1693
1720
|
// Detections with limited supporting data, resulting in a higher likelihood of false positives
|
|
1694
1721
|
detectImprecise = async tokenizer => {
|
package/source/supported.js
CHANGED
|
@@ -184,6 +184,7 @@ export const extensions = [
|
|
|
184
184
|
'key',
|
|
185
185
|
'numbers',
|
|
186
186
|
'pages',
|
|
187
|
+
'iso',
|
|
187
188
|
];
|
|
188
189
|
|
|
189
190
|
export const mimeTypes = [
|
|
@@ -365,4 +366,5 @@ export const mimeTypes = [
|
|
|
365
366
|
'application/vnd.apple.keynote',
|
|
366
367
|
'application/vnd.apple.numbers',
|
|
367
368
|
'application/vnd.apple.pages',
|
|
369
|
+
'application/x-iso9660-image',
|
|
368
370
|
];
|