1
0
mirror of synced 2026-05-22 14:43:19 +00:00

Workaround for TypeScript, importing Node function parseStream with module-resolution set to bundler

This commit is contained in:
Borewit
2025-04-11 15:37:56 +02:00
committed by Borewit
parent 948ef5ce7c
commit 35e1e51bfa
+10 -1
View File
@@ -10,6 +10,7 @@ import { hasID3v1Header } from './id3v1/ID3v1Parser.js';
import { getLyricsHeaderLength } from './lyrics3/Lyrics3.js';
import type { IAudioMetadata, INativeTagDict, IOptions, IPicture, IPrivateOptions, ITag } from './type.js';
import type { Readable } from 'node:stream';
export type { IFileInfo } from 'strtok3';
@@ -131,7 +132,15 @@ export async function scanAppendingHeaders(tokenizer: IRandomAccessTokenizer, op
* This method will throw an Error, always.
*/
export async function parseFile(filePath: string, options: IOptions = {}): Promise<IAudioMetadata> {
throw new Error('To load Web API File objects use parseBlob instead. For loading files, you need to import with the "node" condition is set.');
throw new Error('This function require a Node engine. To load Web API File objects use parseBlob instead.');
}
/**
* Implementation only available when loaded as Node.js
* This method will throw an Error, always.
*/
export async function parseStream(stream: Readable, fileInfo?: IFileInfo | string, options: IOptions = {}): Promise<IAudioMetadata> {
throw new Error('This function require a Node engine.');
}
/**