Skip to content

Commit 935470e

Browse files
Add support for ARJ (sindresorhus#589)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
1 parent cd011b4 commit 935470e

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

core.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export type FileExtension =
146146
| 'dwg'
147147
| 'parquet'
148148
| 'class'
149+
| 'arj'
149150
; // eslint-disable-line semi-style
150151

151152
export type MimeType =
@@ -288,6 +289,7 @@ export type MimeType =
288289
| 'image/vnd.dwg'
289290
| 'application/x-parquet'
290291
| 'application/java-vm'
292+
| 'application/x-arj'
291293
; // eslint-disable-line semi-style
292294

293295
export type FileTypeResult = {

core.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ class FileTypeParser {
149149
};
150150
}
151151

152+
if (this.check([0x60, 0xEA])) {
153+
return {
154+
ext: 'arj',
155+
mime: 'application/x-arj',
156+
};
157+
}
158+
152159
// -- 3-byte signatures --
153160

154161
if (this.check([0xEF, 0xBB, 0xBF])) { // UTF-8-BOM

fixture/fixture.arj

124 Bytes
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@
198198
"pst",
199199
"dwg",
200200
"parquet",
201-
"class"
201+
"class",
202+
"arj"
202203
],
203204
"dependencies": {
204205
"readable-web-to-node-stream": "^3.0.2",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ Returns a `Set<string>` of supported MIME types.
351351
- [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio
352352
- [`apng`](https://en.wikipedia.org/wiki/APNG) - Animated Portable Network Graphics
353353
- [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file
354+
- [`arj`](https://en.wikipedia.org/wiki/ARJ) - Archive file
354355
- [`arrow`](https://arrow.apache.org) - Columnar format for tables of data
355356
- [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file
356357
- [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export const extensions = [
143143
'dwg',
144144
'parquet',
145145
'class',
146+
'arj',
146147
];
147148

148149
export const mimeTypes = [
@@ -285,4 +286,5 @@ export const mimeTypes = [
285286
'image/vnd.dwg',
286287
'application/x-parquet',
287288
'application/java-vm',
289+
'application/x-arj',
288290
];

0 commit comments

Comments
 (0)