file-type
Advanced tools
+1
-1
@@ -30,3 +30,3 @@ /** | ||
| async fromStream(stream) { | ||
| const tokenizer = await (stream instanceof WebReadableStream ? strtok3.fromWebStream(stream, this.tokenizerOptions) : strtok3.fromStream(stream, this.tokenizerOptions)); | ||
| const tokenizer = await (stream instanceof WebReadableStream ? strtok3.fromWebStream(stream, this.getTokenizerOptions()) : strtok3.fromStream(stream, this.getTokenizerOptions())); | ||
| try { | ||
@@ -33,0 +33,0 @@ return await super.fromTokenizer(tokenizer); |
+1
-1
| { | ||
| "name": "file-type", | ||
| "version": "21.3.1", | ||
| "version": "21.3.2", | ||
| "description": "Detect the file type of a file, stream, or data", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+5
-4
@@ -19,8 +19,9 @@ <h1 align="center" title="file-type"> | ||
| **This package is an ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). For TypeScript + CommonJS, see [`load-esm`](https://github.com/Borewit/load-esm).** | ||
| **This package is an ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). For TypeScript + CommonJS, see [`load-esm`](https://github.com/Borewit/load-esm).** If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM. | ||
| If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM. | ||
| > [!IMPORTANT] | ||
| > File type detection is based on binary signatures (magic numbers) and is a best-effort hint. It does not guarantee the file is actually of that type or that the file is valid/not malformed. | ||
| > | ||
| > Robustness against malformed input is best-effort. When processing untrusted files on a server, enforce a reasonable file size limit and use a worker thread with a timeout (e.g., [`make-asynchronous`](https://github.com/sindresorhus/make-asynchronous)). These are not considered security issues in this package. | ||
| File type detection is based on binary signatures (magic numbers) and should be treated as a best-effort hint, not a guarantee. | ||
| ## Usage | ||
@@ -27,0 +28,0 @@ |
Sorry, the diff of this file is too big to display
132082
4.98%3113
6.06%665
0.15%