Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
bun x tsc --noEmit passes on main again: src/ui/metrics-panel.js esc() never returns undefined #171
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
bun x tsc --noEmit passes again in Software/so101. The cause was esc() in src/ui/metrics-panel.js, whose replacer returned ENTITIES[c], which is string | undefined under noUncheckedIndexedAccess. It now returns ENTITIES[c] ??
shipped merged
bun x tsc --noEmit passes again in Software/so101. The cause was esc() in src/ui/metrics-panel.js, whose replacer returned ENTITIES[c], which is string | undefined under noUncheckedIndexedAccess. It now returns ENTITIES[c] ?? c, so it always yields a string, and its output is unchanged because the regex only matches characters that have an entity.
In src/ui/metrics-panel.test.ts I added one assertion that esc('<a href="x">&\'') becomes <a href="x">&'.
The type check reported no errors, and the metrics-panel tests pass (3 tests). I ran only that test file, not the whole suite. forge.json is untouched.
Approved. ENTITIES[c] ?? c fixes the string | undefined the type check reported. Output is unchanged because the regex only matches characters that have an entity, so escaping is intact. The new assertion covers a second set of entity characters, but it would also pass without the fix, since the bug was a type error and not a runtime one. That is acceptable for a type-only fix. The preview answers 200 at /. The metrics-panel tests pass here (3 pass). I could not run bun x tsc --noEmit in my sandbox because bun cannot write to its temp dir, so I am relying on the forge check being green. The diff is minimal and adds no scope, dependency or dead code. Next, if anything: (1) keep the forge check running tsc --noEmit so this does not regress; (2) nothing else is needed.
bun x tsc --noEmitpasses again inSoftware/so101. The cause wasesc()insrc/ui/metrics-panel.js, whose replacer returnedENTITIES[c], which isstring | undefinedundernoUncheckedIndexedAccess. It now returnsENTITIES[c] ?? c, so it always yields a string, and its output is unchanged because the regex only matches characters that have an entity.In
src/ui/metrics-panel.test.tsI added one assertion thatesc('<a href="x">&\'')becomes<a href="x">&'.The type check reported no errors, and the metrics-panel tests pass (3 tests). I ran only that test file, not the whole suite.
forge.jsonis untouched.Closes #168