Skip to content

Commit 34ab7d4

Browse files
authored
Add support for Avro (#597)
1 parent 1978fc6 commit 34ab7d4

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
@@ -150,6 +150,7 @@ export type FileExtension =
150150
| 'arj'
151151
| 'cpio'
152152
| 'ace'
153+
| 'avro'
153154
; // eslint-disable-line semi-style
154155

155156
export type MimeType =
@@ -296,6 +297,7 @@ export type MimeType =
296297
| 'application/x-arj'
297298
| 'application/x-cpio'
298299
| 'application/x-ace-compressed'
300+
| 'application/avro'
299301
; // eslint-disable-line semi-style
300302

301303
export type FileTypeResult = {

core.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ class FileTypeParser {
249249
};
250250
}
251251

252+
if (this.check([0x4F, 0x62, 0x6A, 0x01])) {
253+
return {
254+
ext: 'avro',
255+
mime: 'application/avro',
256+
};
257+
}
258+
252259
if (this.checkString('FLIF')) {
253260
return {
254261
ext: 'flif',

fixture/fixture.avro

191 Bytes
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@
202202
"class",
203203
"arj",
204204
"cpio",
205-
"ace"
205+
"ace",
206+
"avro"
206207
],
207208
"dependencies": {
208209
"readable-web-to-node-stream": "^3.0.2",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ Returns a `Set<string>` of supported MIME types.
359359
- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
360360
- [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file
361361
- [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format
362+
- [`avro`](https://en.wikipedia.org/wiki/Apache_Avro#Avro_Object_Container_File) - Object container file developed by Apache Avro
362363
- [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project
363364
- [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file
364365
- [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export const extensions = [
147147
'arj',
148148
'cpio',
149149
'ace',
150+
'avro',
150151
];
151152

152153
export const mimeTypes = [
@@ -293,4 +294,5 @@ export const mimeTypes = [
293294
'application/x-arj',
294295
'application/x-cpio',
295296
'application/x-ace-compressed',
297+
'application/avro',
296298
];

0 commit comments

Comments
 (0)