file-type 4.4.0 → 5.2.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.
Files changed (3) hide show
  1. package/index.js +18 -4
  2. package/package.json +4 -2
  3. package/readme.md +2 -0
package/index.js CHANGED
@@ -377,7 +377,7 @@ module.exports = input => {
377
377
  ) {
378
378
  return {
379
379
  ext: 'woff',
380
- mime: 'application/font-woff'
380
+ mime: 'font/woff'
381
381
  };
382
382
  }
383
383
 
@@ -390,7 +390,7 @@ module.exports = input => {
390
390
  ) {
391
391
  return {
392
392
  ext: 'woff2',
393
- mime: 'application/font-woff'
393
+ mime: 'font/woff2'
394
394
  };
395
395
  }
396
396
 
@@ -411,14 +411,14 @@ module.exports = input => {
411
411
  if (check([0x00, 0x01, 0x00, 0x00, 0x00])) {
412
412
  return {
413
413
  ext: 'ttf',
414
- mime: 'application/font-sfnt'
414
+ mime: 'font/ttf'
415
415
  };
416
416
  }
417
417
 
418
418
  if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {
419
419
  return {
420
420
  ext: 'otf',
421
- mime: 'application/font-sfnt'
421
+ mime: 'font/otf'
422
422
  };
423
423
  }
424
424
 
@@ -534,6 +534,13 @@ module.exports = input => {
534
534
  };
535
535
  }
536
536
 
537
+ if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) {
538
+ return {
539
+ ext: 'mts',
540
+ mime: 'video/mp2t'
541
+ };
542
+ }
543
+
537
544
  if (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) {
538
545
  return {
539
546
  ext: 'blend',
@@ -541,5 +548,12 @@ module.exports = input => {
541
548
  };
542
549
  }
543
550
 
551
+ if (check([0x42, 0x50, 0x47, 0xFB])) {
552
+ return {
553
+ ext: 'bpg',
554
+ mime: 'image/bpg'
555
+ };
556
+ }
557
+
544
558
  return null;
545
559
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-type",
3
- "version": "4.4.0",
3
+ "version": "5.2.0",
4
4
  "description": "Detect the file type of a Buffer/Uint8Array",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/file-type",
@@ -95,9 +95,11 @@
95
95
  "lz",
96
96
  "msi",
97
97
  "mxf",
98
+ "mts",
98
99
  "wasm",
99
100
  "webassembly",
100
- "blend"
101
+ "blend",
102
+ "bpg"
101
103
  ],
102
104
  "devDependencies": {
103
105
  "ava": "*",
package/readme.md CHANGED
@@ -136,8 +136,10 @@ It only needs the first 4100 bytes.
136
136
  - [`lz`](https://en.wikipedia.org/wiki/Lzip)
137
137
  - [`msi`](https://en.wikipedia.org/wiki/Windows_Installer)
138
138
  - [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format)
139
+ - [`mts`](https://en.wikipedia.org/wiki/.m2ts)
139
140
  - [`wasm`](https://en.wikipedia.org/wiki/WebAssembly)
140
141
  - [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format)
142
+ - [`bpg`](https://bellard.org/bpg/)
141
143
 
142
144
  *SVG isn't included as it requires the whole file to be read, but you can get it [here](https://github.com/sindresorhus/is-svg).*
143
145