mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
* fix(inspector): the page runtime carries no wide characters, so inspected pages stay one byte a char * fix(core): the inlined page runtime carries no wide characters either * fix(core): the wide-character check lives in core, which every runtime build image copies
5 lines
191 B
JavaScript
5 lines
191 B
JavaScript
export function firstCharacterThatMakesPagesTwoByte(text) {
|
|
const wide = /[\u{100}-\u{10ffff}]/u.exec(text);
|
|
return wide && `U+${wide[0].codePointAt(0).toString(16)} at ${wide.index}`;
|
|
}
|