file-type 18.3.0 → 18.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core.d.ts CHANGED
@@ -150,6 +150,8 @@ export type FileExtension =
150
150
  | 'arj'
151
151
  | 'cpio'
152
152
  | 'ace'
153
+ | 'avro'
154
+ | 'icc'
153
155
  ; // eslint-disable-line semi-style
154
156
 
155
157
  export type MimeType =
@@ -296,6 +298,8 @@ export type MimeType =
296
298
  | 'application/x-arj'
297
299
  | 'application/x-cpio'
298
300
  | 'application/x-ace-compressed'
301
+ | 'application/avro'
302
+ | 'application/vnd.iccprofile'
299
303
  ; // eslint-disable-line semi-style
300
304
 
301
305
  export type FileTypeResult = {
package/core.js CHANGED
@@ -249,6 +249,13 @@ class FileTypeParser {
249
249
  };
250
250
  }
251
251
 
252
+ if (this.check([0x4F, 0x62, 0x6A, 0x01])) {
253
+ return {
254
+ ext: 'avro',
255
+ mime: 'application/avro',
256
+ };
257
+ }
258
+
252
259
  if (this.checkString('FLIF')) {
253
260
  return {
254
261
  ext: 'flif',
@@ -1304,6 +1311,13 @@ class FileTypeParser {
1304
1311
  // Increase sample size from 12 to 256.
1305
1312
  await tokenizer.peekBuffer(this.buffer, {length: Math.min(256, tokenizer.fileInfo.size), mayBeLess: true});
1306
1313
 
1314
+ if (this.check([0x61, 0x63, 0x73, 0x70], {offset: 36})) {
1315
+ return {
1316
+ ext: 'icc',
1317
+ mime: 'application/vnd.iccprofile',
1318
+ };
1319
+ }
1320
+
1307
1321
  // -- 15-byte signatures --
1308
1322
 
1309
1323
  if (this.checkString('BEGIN:')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-type",
3
- "version": "18.3.0",
3
+ "version": "18.5.0",
4
4
  "description": "Detect the file type of a Buffer/Uint8Array/ArrayBuffer",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/file-type",
@@ -202,7 +202,9 @@
202
202
  "class",
203
203
  "arj",
204
204
  "cpio",
205
- "ace"
205
+ "ace",
206
+ "avro",
207
+ "icc"
206
208
  ],
207
209
  "dependencies": {
208
210
  "readable-web-to-node-stream": "^3.0.2",
@@ -211,12 +213,12 @@
211
213
  },
212
214
  "devDependencies": {
213
215
  "@tokenizer/token": "^0.3.0",
214
- "@types/node": "^18.16.0",
216
+ "@types/node": "^20.1.2",
215
217
  "ava": "^5.2.0",
216
218
  "commonmark": "^0.30.0",
217
219
  "noop-stream": "^1.0.0",
218
220
  "tsd": "^0.28.1",
219
- "xo": "^0.54.1"
221
+ "xo": "^0.54.2"
220
222
  },
221
223
  "xo": {
222
224
  "envs": [
package/readme.md CHANGED
@@ -8,36 +8,6 @@ This package is for detecting binary-based file formats, not text-based formats
8
8
 
9
9
  We accept contributions for commonly used modern file formats, not historical or obscure ones. Open an issue first for discussion.
10
10
 
11
- <br>
12
-
13
- ---
14
-
15
- <div align="center">
16
- <p>
17
- <p>
18
- <sup>
19
- <a href="https://github.com/sponsors/sindresorhus">My open source work is supported by the community</a>
20
- </sup>
21
- </p>
22
- <sup>Special thanks to:</sup>
23
- <br>
24
- <br>
25
- <a href="https://bit.io/?utm_campaign=github_repo&utm_medium=referral&utm_content=file-type&utm_source=github">
26
- <div>
27
- <img src="https://sindresorhus.com/assets/thanks/bitio-logo.svg" width="190" alt="bit.io">
28
- </div>
29
- <b>Instant, shareable cloud PostgreSQL database</b>
30
- <div>
31
- <sup>Import any dataset in seconds, share with anyone with a click, try without signing up</sup>
32
- </div>
33
- </a>
34
- </p>
35
- </div>
36
-
37
- ---
38
-
39
- <br>
40
-
41
11
  ## Install
42
12
 
43
13
  ```sh
@@ -359,6 +329,7 @@ Returns a `Set<string>` of supported MIME types.
359
329
  - [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
360
330
  - [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file
361
331
  - [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format
332
+ - [`avro`](https://en.wikipedia.org/wiki/Apache_Avro#Avro_Object_Container_File) - Object container file developed by Apache Avro
362
333
  - [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project
363
334
  - [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file
364
335
  - [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file
@@ -395,6 +366,7 @@ Returns a `Set<string>` of supported MIME types.
395
366
  - [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
396
367
  - [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file
397
368
  - [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format
369
+ - [`icc`](https://en.wikipedia.org/wiki/ICC_profile) - ICC Profile
398
370
  - [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image
399
371
  - [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
400
372
  - [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
package/supported.js CHANGED
@@ -147,6 +147,8 @@ export const extensions = [
147
147
  'arj',
148
148
  'cpio',
149
149
  'ace',
150
+ 'avro',
151
+ 'icc',
150
152
  ];
151
153
 
152
154
  export const mimeTypes = [
@@ -293,4 +295,6 @@ export const mimeTypes = [
293
295
  'application/x-arj',
294
296
  'application/x-cpio',
295
297
  'application/x-ace-compressed',
298
+ 'application/avro',
299
+ 'application/vnd.iccprofile',
296
300
  ];