@depup/file-type 22.0.0-depup.0 → 22.0.1-depup.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/README.md +2 -2
- package/changes.json +1 -1
- package/package.json +4 -3
- package/source/index.js +7 -2
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/file-type
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [file-type](https://www.npmjs.com/package/file-type) @ 22.0.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [file-type](https://www.npmjs.com/package/file-type) @ 22.0.1 |
|
|
17
|
+
| Processed | 2026-04-09 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/file-type",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1-depup.0",
|
|
4
4
|
"description": "Detect the file type of a file, stream, or data (with updated dependencies)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/file-type",
|
|
@@ -249,6 +249,7 @@
|
|
|
249
249
|
"@types/node": "^25.5.0",
|
|
250
250
|
"ava": "^7.0.0",
|
|
251
251
|
"commonmark": "^0.31.2",
|
|
252
|
+
"esbuild": "^0.28.0",
|
|
252
253
|
"get-stream": "^9.0.1",
|
|
253
254
|
"tsd": "^0.33.0",
|
|
254
255
|
"xo": "^2.0.2"
|
|
@@ -282,8 +283,8 @@
|
|
|
282
283
|
"changes": {},
|
|
283
284
|
"depsUpdated": 0,
|
|
284
285
|
"originalPackage": "file-type",
|
|
285
|
-
"originalVersion": "22.0.
|
|
286
|
-
"processedAt": "2026-
|
|
286
|
+
"originalVersion": "22.0.1",
|
|
287
|
+
"processedAt": "2026-04-09T16:36:52.873Z",
|
|
287
288
|
"smokeTest": "passed"
|
|
288
289
|
}
|
|
289
290
|
}
|
package/source/index.js
CHANGED
|
@@ -62,6 +62,11 @@ function getKnownFileSizeOrMaximum(fileSize) {
|
|
|
62
62
|
return Math.max(0, fileSize);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// Keep the specifier non-literal at the call site so browser bundlers do not try to resolve Node-only imports.
|
|
66
|
+
function importAtRuntime(specifier) {
|
|
67
|
+
return import(specifier);
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
// Wrap stream in an identity TransformStream to avoid BYOB readers.
|
|
66
71
|
// Node.js has a bug where calling controller.close() inside a BYOB stream's
|
|
67
72
|
// pull() callback does not resolve pending reader.read() calls, causing
|
|
@@ -258,8 +263,8 @@ export class FileTypeParser {
|
|
|
258
263
|
this.options.signal?.throwIfAborted();
|
|
259
264
|
// TODO: Remove this when `strtok3.fromFile()` safely rejects non-regular filesystem objects without a pathname race.
|
|
260
265
|
const [{default: fsPromises}, {FileTokenizer}] = await Promise.all([
|
|
261
|
-
|
|
262
|
-
|
|
266
|
+
importAtRuntime('node:fs/promises'),
|
|
267
|
+
importAtRuntime('strtok3'),
|
|
263
268
|
]);
|
|
264
269
|
const fileHandle = await fsPromises.open(path, fsPromises.constants.O_RDONLY | fsPromises.constants.O_NONBLOCK);
|
|
265
270
|
const fileStat = await fileHandle.stat();
|