docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a small module that translates between JavaScript strings and arrays of Unicode code points without losing surrogate pair information.
"Hi \\uD83D\\uDE00" yields [72, 105, 32, 128512] @test"\\uD83Dabc" yields [55357, 97, 98, 99] preserving the lone surrogate half instead of dropping or replacing it @test[0x48, 0x69, 0x20, 0x1F680] renders "Hi \\uD83D\\uDE80" @test[0xD834, 0xDF06, 0xD800] renders "\\uD834\\uDF06\\uD800", combining valid pairs while leaving the unmatched half untouched @test[0xD83D, 0xDE03] returns "\\uD83D\\uDE03" without mutating the provided array after the call @testexport function toCodePoints(input: string): number[];
export function fromCodePoints(codePoints: readonly number[]): string;Provides UCS-2/Unicode conversion helpers for bridging JS strings and code point arrays.