file-type 18.7.0 → 19.0.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
@@ -192,7 +192,7 @@ export type MimeType =
192
192
  | 'video/webm'
193
193
  | 'video/quicktime'
194
194
  | 'video/vnd.avi'
195
- | 'audio/vnd.wave'
195
+ | 'audio/wav'
196
196
  | 'audio/qcelp'
197
197
  | 'audio/x-ms-asf'
198
198
  | 'video/x-ms-asf'
package/core.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {Buffer} from 'node:buffer';
2
2
  import * as Token from 'token-types';
3
- import * as strtok3 from 'strtok3/core'; // eslint-disable-line n/file-extension-in-import
3
+ import * as strtok3 from 'strtok3/core';
4
4
  import {
5
5
  stringToBytes,
6
6
  tarHeaderChecksumMatches,
@@ -794,7 +794,7 @@ export class FileTypeParser {
794
794
  const element = await readElement();
795
795
  if (element.id === 0x42_82) {
796
796
  const rawValue = await tokenizer.readToken(new Token.StringType(element.len, 'utf-8'));
797
- return rawValue.replace(/\00.*$/g, ''); // Return DocType
797
+ return rawValue.replaceAll(/\00.*$/g, ''); // Return DocType
798
798
  }
799
799
 
800
800
  await tokenizer.ignore(element.len); // ignore payload
@@ -835,7 +835,7 @@ export class FileTypeParser {
835
835
  if (this.check([0x57, 0x41, 0x56, 0x45], {offset: 8})) {
836
836
  return {
837
837
  ext: 'wav',
838
- mime: 'audio/vnd.wave',
838
+ mime: 'audio/wav',
839
839
  };
840
840
  }
841
841
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-type",
3
- "version": "18.7.0",
3
+ "version": "19.0.0",
4
4
  "description": "Detect the file type of a Buffer/Uint8Array/ArrayBuffer",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/file-type",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "sideEffects": false,
22
22
  "engines": {
23
- "node": ">=14.16"
23
+ "node": ">=18"
24
24
  },
25
25
  "scripts": {
26
26
  "test": "xo && ava && tsd"
@@ -216,18 +216,21 @@
216
216
  },
217
217
  "devDependencies": {
218
218
  "@tokenizer/token": "^0.3.0",
219
- "@types/node": "^20.1.2",
220
- "ava": "^5.2.0",
219
+ "@types/node": "^20.10.7",
220
+ "ava": "^6.0.1",
221
221
  "commonmark": "^0.30.0",
222
222
  "noop-stream": "^1.0.0",
223
- "tsd": "^0.28.1",
224
- "xo": "^0.54.2"
223
+ "tsd": "^0.30.3",
224
+ "xo": "^0.56.0"
225
225
  },
226
226
  "xo": {
227
227
  "envs": [
228
228
  "node",
229
229
  "browser"
230
230
  ],
231
+ "ignores": [
232
+ "fixture"
233
+ ],
231
234
  "rules": {
232
235
  "no-inner-declarations": "warn",
233
236
  "no-await-in-loop": "warn",
package/supported.js CHANGED
@@ -189,7 +189,7 @@ export const mimeTypes = [
189
189
  'video/webm',
190
190
  'video/quicktime',
191
191
  'video/vnd.avi',
192
- 'audio/vnd.wave',
192
+ 'audio/wav',
193
193
  'audio/qcelp',
194
194
  'audio/x-ms-asf',
195
195
  'video/x-ms-asf',