file-type 18.4.0 → 18.6.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/core.d.ts +4 -0
- package/core.js +15 -1
- package/package.json +4 -2
- package/readme.md +2 -0
- package/supported.js +4 -0
package/core.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export type FileExtension =
|
|
|
50
50
|
| 'epub'
|
|
51
51
|
| 'mobi'
|
|
52
52
|
| 'elf'
|
|
53
|
+
| 'macho'
|
|
53
54
|
| 'exe'
|
|
54
55
|
| 'swf'
|
|
55
56
|
| 'rtf'
|
|
@@ -151,6 +152,7 @@ export type FileExtension =
|
|
|
151
152
|
| 'cpio'
|
|
152
153
|
| 'ace'
|
|
153
154
|
| 'avro'
|
|
155
|
+
| 'icc'
|
|
154
156
|
; // eslint-disable-line semi-style
|
|
155
157
|
|
|
156
158
|
export type MimeType =
|
|
@@ -208,6 +210,7 @@ export type MimeType =
|
|
|
208
210
|
| 'audio/amr'
|
|
209
211
|
| 'application/pdf'
|
|
210
212
|
| 'application/x-elf'
|
|
213
|
+
| 'application/x-mach-binary'
|
|
211
214
|
| 'application/x-msdownload'
|
|
212
215
|
| 'application/x-shockwave-flash'
|
|
213
216
|
| 'application/rtf'
|
|
@@ -298,6 +301,7 @@ export type MimeType =
|
|
|
298
301
|
| 'application/x-cpio'
|
|
299
302
|
| 'application/x-ace-compressed'
|
|
300
303
|
| 'application/avro'
|
|
304
|
+
| 'application/vnd.iccprofile'
|
|
301
305
|
; // eslint-disable-line semi-style
|
|
302
306
|
|
|
303
307
|
export type FileTypeResult = {
|
package/core.js
CHANGED
|
@@ -694,7 +694,7 @@ class FileTypeParser {
|
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
696
|
|
|
697
|
-
// https://github.com/
|
|
697
|
+
// https://github.com/file/file/blob/master/magic/Magdir/matroska
|
|
698
698
|
if (this.check([0x1A, 0x45, 0xDF, 0xA3])) { // Root element: EBML
|
|
699
699
|
async function readField() {
|
|
700
700
|
const msb = await tokenizer.peekNumber(Token.UINT8);
|
|
@@ -855,6 +855,13 @@ class FileTypeParser {
|
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
857
|
|
|
858
|
+
if (this.check([0xCF, 0xFA, 0xED, 0xFE])) {
|
|
859
|
+
return {
|
|
860
|
+
ext: 'macho',
|
|
861
|
+
mime: 'application/x-mach-binary',
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
|
|
858
865
|
// -- 5-byte signatures --
|
|
859
866
|
|
|
860
867
|
if (this.check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {
|
|
@@ -1311,6 +1318,13 @@ class FileTypeParser {
|
|
|
1311
1318
|
// Increase sample size from 12 to 256.
|
|
1312
1319
|
await tokenizer.peekBuffer(this.buffer, {length: Math.min(256, tokenizer.fileInfo.size), mayBeLess: true});
|
|
1313
1320
|
|
|
1321
|
+
if (this.check([0x61, 0x63, 0x73, 0x70], {offset: 36})) {
|
|
1322
|
+
return {
|
|
1323
|
+
ext: 'icc',
|
|
1324
|
+
mime: 'application/vnd.iccprofile',
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1314
1328
|
// -- 15-byte signatures --
|
|
1315
1329
|
|
|
1316
1330
|
if (this.checkString('BEGIN:')) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "file-type",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.6.0",
|
|
4
4
|
"description": "Detect the file type of a Buffer/Uint8Array/ArrayBuffer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/file-type",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"is",
|
|
53
53
|
"exif",
|
|
54
54
|
"elf",
|
|
55
|
+
"macho",
|
|
55
56
|
"exe",
|
|
56
57
|
"binary",
|
|
57
58
|
"buffer",
|
|
@@ -203,7 +204,8 @@
|
|
|
203
204
|
"arj",
|
|
204
205
|
"cpio",
|
|
205
206
|
"ace",
|
|
206
|
-
"avro"
|
|
207
|
+
"avro",
|
|
208
|
+
"icc"
|
|
207
209
|
],
|
|
208
210
|
"dependencies": {
|
|
209
211
|
"readable-web-to-node-stream": "^3.0.2",
|
package/readme.md
CHANGED
|
@@ -366,6 +366,7 @@ Returns a `Set<string>` of supported MIME types.
|
|
|
366
366
|
- [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
|
|
367
367
|
- [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file
|
|
368
368
|
- [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format
|
|
369
|
+
- [`icc`](https://en.wikipedia.org/wiki/ICC_profile) - ICC Profile
|
|
369
370
|
- [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image
|
|
370
371
|
- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
|
|
371
372
|
- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
|
|
@@ -387,6 +388,7 @@ Returns a `Set<string>` of supported MIME types.
|
|
|
387
388
|
- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
|
|
388
389
|
- [`m4p`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 files with audio streams encrypted by FairPlay Digital Rights Management as were sold through the iTunes Store
|
|
389
390
|
- [`m4v`](https://en.wikipedia.org/wiki/M4V) - Video container format developed by Apple, which is very similar to the MP4 format
|
|
391
|
+
- [`macho`](https://en.wikipedia.org/wiki/Mach-O) - Mach-O binary format
|
|
390
392
|
- [`mid`](https://en.wikipedia.org/wiki/MIDI) - Musical Instrument Digital Interface file
|
|
391
393
|
- [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information
|
|
392
394
|
- [`mj2`](https://en.wikipedia.org/wiki/Motion_JPEG_2000) - Motion JPEG 2000
|
package/supported.js
CHANGED
|
@@ -48,6 +48,7 @@ export const extensions = [
|
|
|
48
48
|
'pdf',
|
|
49
49
|
'epub',
|
|
50
50
|
'elf',
|
|
51
|
+
'macho',
|
|
51
52
|
'exe',
|
|
52
53
|
'swf',
|
|
53
54
|
'rtf',
|
|
@@ -148,6 +149,7 @@ export const extensions = [
|
|
|
148
149
|
'cpio',
|
|
149
150
|
'ace',
|
|
150
151
|
'avro',
|
|
152
|
+
'icc',
|
|
151
153
|
];
|
|
152
154
|
|
|
153
155
|
export const mimeTypes = [
|
|
@@ -205,6 +207,7 @@ export const mimeTypes = [
|
|
|
205
207
|
'audio/amr',
|
|
206
208
|
'application/pdf',
|
|
207
209
|
'application/x-elf',
|
|
210
|
+
'application/x-mach-binary',
|
|
208
211
|
'application/x-msdownload',
|
|
209
212
|
'application/x-shockwave-flash',
|
|
210
213
|
'application/rtf',
|
|
@@ -295,4 +298,5 @@ export const mimeTypes = [
|
|
|
295
298
|
'application/x-cpio',
|
|
296
299
|
'application/x-ace-compressed',
|
|
297
300
|
'application/avro',
|
|
301
|
+
'application/vnd.iccprofile',
|
|
298
302
|
];
|