* bug fix, see  #112013

* Update dom.ts

fix 1.51.0 new multibyteAwareBtoa function, see # #112013

* Update dom.ts

format document
This commit is contained in:
YtCsj
2020-12-09 00:52:40 +08:00
committed by GitHub
parent b2eedd8ee0
commit 3a47fc387a

View File

@@ -1400,7 +1400,12 @@ function toBinary(str: string): string {
for (let i = 0; i < codeUnits.length; i++) {
codeUnits[i] = str.charCodeAt(i);
}
return String.fromCharCode(...new Uint8Array(codeUnits.buffer));
let binary = '';
const uint8array = new Uint8Array(codeUnits.buffer);
for (let i = 0; i < uint8array.length; i++) {
binary += String.fromCharCode(uint8array[i]);
}
return binary;
}
/**