Skip to content

Commit

Permalink
Convert Iterator of detectors to array of detectors, keeping backward…
Browse files Browse the repository at this point in the history
…s compatibility
  • Loading branch information
Borewit committed Dec 17, 2024
1 parent def5539 commit faff5ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ export async function fileTypeStream(webStream, options) {

export class FileTypeParser {
constructor(options) {
this.detectors = options?.customDetectors ?? [];
this.detectors = [...(options?.customDetectors ?? []), this.parse];
this.tokenizerOptions = {
abortSignal: options?.signal,
};
this.detectors.push(this.parse); // Assign core file-type detector
}

async fromTokenizer(tokenizer) {
Expand Down

0 comments on commit faff5ea

Please sign in to comment.