Skip to content

Commit 1899fc1

Browse files
authored
Add support for ACE (#592)
1 parent f84e96c commit 1899fc1

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

core.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export type FileExtension =
148148
| 'class'
149149
| 'arj'
150150
| 'cpio'
151+
| 'ace'
151152
; // eslint-disable-line semi-style
152153

153154
export type MimeType =
@@ -292,6 +293,7 @@ export type MimeType =
292293
| 'application/java-vm'
293294
| 'application/x-arj'
294295
| 'application/x-cpio'
296+
| 'application/x-ace-compressed'
295297
; // eslint-disable-line semi-style
296298

297299
export type FileTypeResult = {

core.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,16 @@ class FileTypeParser {
10201020
};
10211021
}
10221022

1023+
if (this.checkString('**ACE', {offset: 7})) {
1024+
await tokenizer.peekBuffer(this.buffer, {length: 14, mayBeLess: true});
1025+
if (this.checkString('**', {offset: 12})) {
1026+
return {
1027+
ext: 'ace',
1028+
mime: 'application/x-ace-compressed',
1029+
};
1030+
}
1031+
}
1032+
10231033
// -- 8-byte signatures --
10241034

10251035
if (this.check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) {

fixture/fixture.ace

97 Bytes
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@
200200
"parquet",
201201
"class",
202202
"arj",
203-
"cpio"
203+
"cpio",
204+
"ace"
204205
],
205206
"dependencies": {
206207
"readable-web-to-node-stream": "^3.0.2",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ Returns a `Set<string>` of supported MIME types.
344344
- [`Z`](https://fileinfo.com/extension/z) - Unix Compressed File
345345
- [`aac`](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) - Advanced Audio Coding
346346
- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File
347+
- [`ace`](https://en.wikipedia.org/wiki/ACE_(compressed_file_format)) - ACE archive
347348
- [`ai`](https://en.wikipedia.org/wiki/Adobe_Illustrator_Artwork) - Adobe Illustrator Artwork
348349
- [`aif`](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format) - Audio Interchange file
349350
- [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export const extensions = [
145145
'class',
146146
'arj',
147147
'cpio',
148+
'ace',
148149
];
149150

150151
export const mimeTypes = [
@@ -289,4 +290,5 @@ export const mimeTypes = [
289290
'application/java-vm',
290291
'application/x-arj',
291292
'application/x-cpio',
293+
'application/x-ace-compressed',
292294
];

0 commit comments

Comments
 (0)