MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / isHighSurrogate

Function isHighSurrogate

src/utils/characters.ts:7–13  ·  view source on GitHub ↗
(string: string, index = 0)

Source from the content-addressed store, hash-verified

5const HEX_DIGIT = /^[0-9a-fA-F]$/;
6
7export function isHighSurrogate(string: string, index = 0): boolean {
8 if (index < 0 || index >= string.length) {
9 return false;
10 }
11 const charCode = string.charCodeAt(index);
12 return charCode >= MIN_HIGH_SURROGATE && charCode <= MAX_HIGH_SURROGATE;
13}
14
15export function isLowSurrogate(string: string, index = 0): boolean {
16 if (index < 0 || index >= string.length) {

Callers 2

characters.tsFile · 0.90
isSurrogatePairFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected