Add LevelLinter (static checks) and LevelChecker (execution checks) shared by tests and the future author editor

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-16 16:44:05 +02:00
parent a97995342f
commit 2205d64ea3
16 changed files with 1637 additions and 51 deletions
+17
View File
@@ -0,0 +1,17 @@
export function ucs2length(s) {
let result = 0;
let length = s.length;
let index = 0;
let charCode;
while (index < length) {
result++;
charCode = s.charCodeAt(index++);
if (charCode >= 0xd800 && charCode <= 0xdbff && index < length) {
charCode = s.charCodeAt(index);
if ((charCode & 0xfc00) == 0xdc00) {
index++;
}
}
}
return result;
}