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 +1 -1
- package/core.js +3 -3
- package/package.json +9 -6
- package/supported.js +1 -1
package/core.d.ts
CHANGED
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';
|
|
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.
|
|
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/
|
|
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": "
|
|
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": ">=
|
|
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.
|
|
220
|
-
"ava": "^
|
|
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.
|
|
224
|
-
"xo": "^0.
|
|
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",
|