docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Utilities for converting between Unicode code point arrays and strings while preserving edge cases around surrogate halves and leaving provided data intact.
[0x1F642, 0x61] yields the string "\u{1F642}a" and leaves the original array unchanged. @test[0xD83D, 0x74, 0x65, 0x73, 0x74], preserving the unmatched high surrogate half. @teststringToCodePoints on "hi\u{1F680}" returns [0x68, 0x69, 0x1F680], and piping that result through codePointsToString yields the original string. @test/**
* Converts an array of Unicode code points to a string without mutating the provided array.
* @param {number[]} codePoints
* @returns {string}
*/
export function codePointsToString(codePoints);
/**
* Converts a string to an array of Unicode code points, preserving unmatched surrogate halves rather than dropping them.
* @param {string} text
* @returns {number[]}
*/
export function stringToCodePoints(text);Provides Unicode code point conversion helpers.