MCPcopy
hub / github.com/xtermjs/xterm.js / stringFromCodePoint

Function stringFromCodePoint

src/common/input/TextDecoder.ts:13–19  ·  view source on GitHub ↗
(codePoint: number)

Source from the content-addressed store, hash-verified

11 * and use this faster version instead.
12 */
13export function stringFromCodePoint(codePoint: number): string {
14 if (codePoint > 0xFFFF) {
15 codePoint -= 0x10000;
16 return String.fromCharCode((codePoint >> 10) + 0xD800) + String.fromCharCode((codePoint % 0x400) + 0xDC00);
17 }
18 return String.fromCharCode(codePoint);
19}
20
21/**
22 * Convert UTF32 char codes into JS string.

Callers 13

printMethod · 0.90
printFunction · 0.90
getCharsMethod · 0.90
getMethod · 0.90
getStringMethod · 0.90
addCodepointToCellMethod · 0.90
translateToStringMethod · 0.90
toStringFunction · 0.90

Calls

no outgoing calls

Tested by 2

printFunction · 0.72
toStringFunction · 0.72