Files
MapLibreParticleLab/packages/maplibre-particle-rn/test/EncodedFieldGuards.test.ts
OpenAI Codex 75a974e775
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
fix: close STEP-078 V4 bridge guard audit
2026-09-13 17:14:50 +08:00

9 lines
418 B
TypeScript

import { hasValidEncodedIdUtf8Length } from "../src/EncodedFieldGuards";
const expect = (value: boolean): void => { if (!value) throw new Error("encoded UTF-8 ID guard failed"); };
expect(hasValidEncodedIdUtf8Length("a".repeat(64)));
expect(!hasValidEncodedIdUtf8Length(""));
// 33 CJK code points are within a 64-character UI limit but occupy 99 UTF-8 bytes.
expect(!hasValidEncodedIdUtf8Length("风".repeat(33)));