file-type 18.5.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 +2 -0
- package/core.js +8 -1
- package/package.json +2 -1
- package/readme.md +1 -0
- package/supported.js +2 -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'
|
|
@@ -209,6 +210,7 @@ export type MimeType =
|
|
|
209
210
|
| 'audio/amr'
|
|
210
211
|
| 'application/pdf'
|
|
211
212
|
| 'application/x-elf'
|
|
213
|
+
| 'application/x-mach-binary'
|
|
212
214
|
| 'application/x-msdownload'
|
|
213
215
|
| 'application/x-shockwave-flash'
|
|
214
216
|
| 'application/rtf'
|
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])) {
|
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",
|
package/readme.md
CHANGED
|
@@ -388,6 +388,7 @@ Returns a `Set<string>` of supported MIME types.
|
|
|
388
388
|
- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
|
|
389
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
|
|
390
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
|
|
391
392
|
- [`mid`](https://en.wikipedia.org/wiki/MIDI) - Musical Instrument Digital Interface file
|
|
392
393
|
- [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information
|
|
393
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',
|
|
@@ -206,6 +207,7 @@ export const mimeTypes = [
|
|
|
206
207
|
'audio/amr',
|
|
207
208
|
'application/pdf',
|
|
208
209
|
'application/x-elf',
|
|
210
|
+
'application/x-mach-binary',
|
|
209
211
|
'application/x-msdownload',
|
|
210
212
|
'application/x-shockwave-flash',
|
|
211
213
|
'application/rtf',
|