diff --git a/core.d.ts b/core.d.ts index 3407946e..ba3142dd 100644 --- a/core.d.ts +++ b/core.d.ts @@ -150,6 +150,7 @@ export type FileExtension = | 'arj' | 'cpio' | 'ace' + | 'avro' ; // eslint-disable-line semi-style export type MimeType = @@ -296,6 +297,7 @@ export type MimeType = | 'application/x-arj' | 'application/x-cpio' | 'application/x-ace-compressed' + | 'application/avro' ; // eslint-disable-line semi-style export type FileTypeResult = { diff --git a/core.js b/core.js index c5ebafae..843ad9ea 100644 --- a/core.js +++ b/core.js @@ -249,6 +249,13 @@ class FileTypeParser { }; } + if (this.check([0x4F, 0x62, 0x6A, 0x01])) { + return { + ext: 'avro', + mime: 'application/avro', + }; + } + if (this.checkString('FLIF')) { return { ext: 'flif', diff --git a/fixture/fixture.avro b/fixture/fixture.avro new file mode 100644 index 00000000..8b4981ba Binary files /dev/null and b/fixture/fixture.avro differ diff --git a/package.json b/package.json index 54f012eb..088fcbc1 100644 --- a/package.json +++ b/package.json @@ -202,7 +202,8 @@ "class", "arj", "cpio", - "ace" + "ace", + "avro" ], "dependencies": { "readable-web-to-node-stream": "^3.0.2", diff --git a/readme.md b/readme.md index 114bae41..a4881265 100644 --- a/readme.md +++ b/readme.md @@ -359,6 +359,7 @@ Returns a `Set` of supported MIME types. - [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format - [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file - [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format +- [`avro`](https://en.wikipedia.org/wiki/Apache_Avro#Avro_Object_Container_File) - Object container file developed by Apache Avro - [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project - [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file - [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file diff --git a/supported.js b/supported.js index 2eb9e9d4..42b45c49 100644 --- a/supported.js +++ b/supported.js @@ -147,6 +147,7 @@ export const extensions = [ 'arj', 'cpio', 'ace', + 'avro', ]; export const mimeTypes = [ @@ -293,4 +294,5 @@ export const mimeTypes = [ 'application/x-arj', 'application/x-cpio', 'application/x-ace-compressed', + 'application/avro', ];