file-type
Advanced tools
Comparing version 19.4.0 to 19.4.1
@@ -6,3 +6,3 @@ /** | ||
import type {ReadableStream as WebReadableStream} from 'node:stream/web'; | ||
import type {ITokenizer} from 'strtok3'; | ||
import type {ITokenizer, AnyWebByteStream} from 'strtok3'; | ||
@@ -354,3 +354,3 @@ /** | ||
*/ | ||
export function fileTypeFromStream(stream: AnyWebReadableStream<Uint8Array>): Promise<FileTypeResult | undefined>; | ||
export function fileTypeFromStream(stream: AnyWebByteStream): Promise<FileTypeResult | undefined>; | ||
@@ -357,0 +357,0 @@ /** |
@@ -54,4 +54,4 @@ /** | ||
export async function fileTypeStream(webStream) { | ||
return new FileTypeParser().toDetectionStream(webStream); | ||
export async function fileTypeStream(webStream, options) { | ||
return new FileTypeParser(options).toDetectionStream(webStream, options); | ||
} | ||
@@ -58,0 +58,0 @@ |
@@ -6,2 +6,3 @@ /** | ||
import type {Readable as NodeReadableStream} from 'node:stream'; | ||
import type {AnyWebByteStream} from 'strtok3'; | ||
import type {FileTypeResult, StreamOptions, AnyWebReadableStream, Detector, AnyWebReadableByteStreamWithFileType} from './core.js'; | ||
@@ -89,4 +90,4 @@ import {FileTypeParser} from './core.js'; | ||
export function fileTypeStream(readableStream: NodeReadableStream, options?: StreamOptions): Promise<ReadableStreamWithFileType>; | ||
export function fileTypeStream(webStream: AnyWebReadableStream<Uint8Array>, options?: StreamOptions): Promise<AnyWebReadableByteStreamWithFileType>; | ||
export function fileTypeStream(webStream: AnyWebByteStream, options?: StreamOptions): Promise<AnyWebReadableByteStreamWithFileType>; | ||
export * from './core.js'; |
@@ -6,3 +6,3 @@ /** | ||
import {ReadableStream as WebReadableStream} from 'node:stream/web'; | ||
import {pipeline, PassThrough} from 'node:stream'; | ||
import {pipeline, PassThrough, Readable} from 'node:stream'; | ||
import * as strtok3 from 'strtok3'; | ||
@@ -31,3 +31,3 @@ import {FileTypeParser, reasonableDetectionSizeInBytes} from './core.js'; | ||
async toDetectionStream(readableStream, options = {}) { | ||
if (readableStream instanceof WebReadableStream) { | ||
if (!(readableStream instanceof Readable)) { | ||
return super.toDetectionStream(readableStream, options); | ||
@@ -34,0 +34,0 @@ } |
{ | ||
"name": "file-type", | ||
"version": "19.4.0", | ||
"version": "19.4.1", | ||
"description": "Detect the file type of a file, stream, or data", | ||
@@ -222,3 +222,3 @@ "license": "MIT", | ||
"get-stream": "^9.0.1", | ||
"strtok3": "^8.0.0", | ||
"strtok3": "^8.1.0", | ||
"token-types": "^6.0.0", | ||
@@ -225,0 +225,0 @@ "uint8array-extras": "^1.3.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98964
2408
Updatedstrtok3@^8.1.0