Skip to content

fix: reject out-of-range tuple paths in reach - #2369

Open
Alanmupa wants to merge 1 commit into
jquense:masterfrom
Alanmupa:fix/reach-tuple-index
Open

Alanmupa wants to merge 1 commit into
jquense:masterfrom
Alanmupa:fix/reach-tuple-index

Conversation

@Alanmupa

Copy link
Copy Markdown

Hi! I noticed reach(tuple([string(), number()]), '[2]') returns undefined. With an extra item in the input array, validateSyncAt('[2]', input) also gets past the input-length check and later fails without a useful path error.

This patch checks the tuple schema's declared length while resolving the path and reports the index and full path. The regression covers both public entry points. All 869 tests passed across the synchronous and asynchronous projects, and I verified lint, TypeScript declarations, and the bundles.

I used Codex to help prepare and validate the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant