Skip to content

Commit 8c540bd

Browse files
committed
Workaround for TypeScript bundler node-resolution
Add stub to fool TypeScript compiler, loading the wrong entry points for the typings. For calling the runtime problems, it throws an error.
1 parent 29ecceb commit 8c540bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/core.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,11 @@ export async function scanAppendingHeaders(tokenizer: IRandomAccessTokenizer, op
124124

125125
options.apeHeader = await APEv2Parser.findApeFooterOffset(tokenizer, apeOffset);
126126
}
127+
128+
/**
129+
* Implementation only available when loaded as Node.js
130+
* This method will throw an Error, always.
131+
*/
132+
export async function parseFile(filePath: string, options: IOptions = {}): Promise<IAudioMetadata> {
133+
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.');
134+
}

0 commit comments

Comments
 (0)