未验证 提交 ce146277 编写于 作者: F Fedor Nezhivoi 提交者: GitHub

remove jschardet typings workaround for #79275 (#101705)

上级 c6c41ed4
......@@ -242,11 +242,7 @@ async function guessEncodingByBuffer(buffer: VSBuffer): Promise<string | null> {
// https://github.com/aadsm/jschardet/blob/v2.1.1/src/index.js#L36-L40
const binaryString = encodeLatin1(limitedBuffer.buffer);
// override type since jschardet expects Buffer even though can accept string
// can be fixed once https://github.com/aadsm/jschardet/pull/58 is merged
const jschardetTypingsWorkaround = binaryString as any;
const guessed = jschardet.detect(jschardetTypingsWorkaround);
const guessed = jschardet.detect(binaryString);
if (!guessed || !guessed.encoding) {
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册