Files
hyperframes/packages/core/scripts/page-script-one-byte.mjs
T
Miguel Ángel 01a5e948be fix(core): page runtimes carry no wide characters, so pages stay one byte a char (#8239)
* 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
2026-11-19 10:18:16 +00:00

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}`;
}