Skip to content

Commit ce14627

Browse files
authored
remove jschardet typings workaround for microsoft#79275 (microsoft#101705)
1 parent c6c41ed commit ce14627

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/vs/workbench/services/textfile/common/encoding.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,7 @@ async function guessEncodingByBuffer(buffer: VSBuffer): Promise<string | null> {
242242
// https://github.com/aadsm/jschardet/blob/v2.1.1/src/index.js#L36-L40
243243
const binaryString = encodeLatin1(limitedBuffer.buffer);
244244

245-
// override type since jschardet expects Buffer even though can accept string
246-
// can be fixed once https://github.com/aadsm/jschardet/pull/58 is merged
247-
const jschardetTypingsWorkaround = binaryString as any;
248-
249-
const guessed = jschardet.detect(jschardetTypingsWorkaround);
245+
const guessed = jschardet.detect(binaryString);
250246
if (!guessed || !guessed.encoding) {
251247
return null;
252248
}

0 commit comments

Comments
 (0)