Chore: improve types & performance

This commit is contained in:
SukkaW
2024-04-16 22:54:22 +08:00
parent 7750a0291d
commit e68b064fe5
5 changed files with 32 additions and 47 deletions

View File

@@ -21,7 +21,7 @@ export class PolyfillTextDecoderStream extends TransformStream<Uint8Array, strin
readonly ignoreBOM: boolean;
constructor(
encoding: Encoding = 'utf-8',
encoding: Bun.Encoding = 'utf-8',
{ fatal = false, ignoreBOM = false }: ConstructorParameters<typeof TextDecoder>[1] = {}
) {
const decoder = new TextDecoder(encoding, { fatal, ignoreBOM });