chore(release): promote 26.9.0-beta.2 to main #100

Merged
chrnx merged 39 commits from develop into main 2026-09-23 01:53:22 +00:00
2 changed files with 9 additions and 0 deletions
Showing only changes of commit 414b188792 - Show all commits

No files matched your search

+3
View File
@@ -97,6 +97,9 @@ const SHAPE: Record<Frame['type'], ShapeCheck> = {
manifest: (frame, bad) => {
if (!isNumber(frame.v)) bad('missing protocol version');
if (!Array.isArray(frame.steps) || !Array.isArray(frame.routes)) bad('steps and routes must be arrays');
// Array.isArray above already guarantees this, but TS does not carry that narrowing through a
// `never`-typed callback parameter — the cast is safe, not a bypass.
if (!(frame.steps as unknown[]).every(isString)) bad('every step must be a string');
},
'rpc-req': (frame, bad) => {
if (!isString(frame.id)) bad('id must be a string');
+6
View File
@@ -32,6 +32,12 @@ describe('protocol codec', () => {
);
});
it('rejects a manifest whose steps array contains a non-string element', () => {
expect(() => decode(JSON.stringify({ type: 'manifest', v: V, steps: [123], routes: [] }))).toThrow(
/every step must be a string/,
);
});
it('throws on malformed json', () => {
expect(() => decode('{not json')).toThrow();
});