MCPcopy Index your code
hub / github.com/xtermjs/xterm.js / toString

Function toString

src/common/input/TextDecoder.test.ts:12–21  ·  view source on GitHub ↗
(data: Uint32Array, length: number)

Source from the content-addressed store, hash-verified

10
11// convert UTF32 codepoints to string
12function toString(data: Uint32Array, length: number): string {
13 if ((String as any).fromCodePoint) {
14 return (String as any).fromCodePoint.apply(null, data.subarray(0, length));
15 }
16 let result = '';
17 for (let i = 0; i < length; ++i) {
18 result += stringFromCodePoint(data[i]);
19 }
20 return result;
21}
22
23// convert "bytestring" (charCode 0-255) to bytes
24function fromByteString(s: string): Uint8Array {

Callers 1

Calls 2

stringFromCodePointFunction · 0.90
applyMethod · 0.80

Tested by

no test coverage detected