diff --git a/core.d.ts b/core.d.ts index f65d949e..032533fc 100644 --- a/core.d.ts +++ b/core.d.ts @@ -146,6 +146,7 @@ export type FileExtension = | 'dwg' | 'parquet' | 'class' + | 'arj' ; // eslint-disable-line semi-style export type MimeType = @@ -288,6 +289,7 @@ export type MimeType = | 'image/vnd.dwg' | 'application/x-parquet' | 'application/java-vm' + | 'application/x-arj' ; // eslint-disable-line semi-style export type FileTypeResult = { diff --git a/core.js b/core.js index 5f1ee351..1c174829 100644 --- a/core.js +++ b/core.js @@ -149,6 +149,13 @@ class FileTypeParser { }; } + if (this.check([0x60, 0xEA])) { + return { + ext: 'arj', + mime: 'application/x-arj', + }; + } + // -- 3-byte signatures -- if (this.check([0xEF, 0xBB, 0xBF])) { // UTF-8-BOM diff --git a/fixture/fixture.arj b/fixture/fixture.arj new file mode 100644 index 00000000..7bce8c7e Binary files /dev/null and b/fixture/fixture.arj differ diff --git a/package.json b/package.json index 0fdea9d6..37d5887b 100644 --- a/package.json +++ b/package.json @@ -198,7 +198,8 @@ "pst", "dwg", "parquet", - "class" + "class", + "arj" ], "dependencies": { "readable-web-to-node-stream": "^3.0.2", diff --git a/readme.md b/readme.md index 9081db4e..de75240e 100644 --- a/readme.md +++ b/readme.md @@ -351,6 +351,7 @@ Returns a `Set` of supported MIME types. - [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio - [`apng`](https://en.wikipedia.org/wiki/APNG) - Animated Portable Network Graphics - [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file +- [`arj`](https://en.wikipedia.org/wiki/ARJ) - Archive file - [`arrow`](https://arrow.apache.org) - Columnar format for tables of data - [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file - [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications diff --git a/supported.js b/supported.js index 631d07a4..10481f89 100644 --- a/supported.js +++ b/supported.js @@ -143,6 +143,7 @@ export const extensions = [ 'dwg', 'parquet', 'class', + 'arj', ]; export const mimeTypes = [ @@ -285,4 +286,5 @@ export const mimeTypes = [ 'image/vnd.dwg', 'application/x-parquet', 'application/java-vm', + 'application/x-arj', ];