Skip to content

Fix filter-sphere CLI number parsing#237

Merged
willeastcott merged 3 commits into
mainfrom
fix-filter-sphere-cli-parsing
May 17, 2026
Merged

Fix filter-sphere CLI number parsing#237
willeastcott merged 3 commits into
mainfrom
fix-filter-sphere-cli-parsing

Conversation

@willeastcott

Copy link
Copy Markdown
Contributor

Fixes #236.

Summary

  • Fix --filter-sphere CLI parsing so Array.map does not pass the element index as parseNumber's optional minimum.
  • Add CLI regression tests for coordinates below their array indexes and negative sphere centers.

Testing

  • node --import tsx --test test\cli.test.mjs
  • npm.cmd run lint
  • npm.cmd test

@willeastcott willeastcott requested a review from Copilot May 17, 2026 18:54
@willeastcott willeastcott self-assigned this May 17, 2026
@willeastcott willeastcott added the bug Something isn't working label May 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CLI argument parsing for --filter-sphere so that Array.map no longer passes the element index into parseNumber’s optional min parameter, and adds regression tests intended to cover coordinates below their array indices and negative sphere centers.

Changes:

  • Fix --filter-sphere parsing by wrapping parseNumber in a single-argument lambda.
  • Add CLI regression tests for --filter-sphere with small/negative coordinates.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/cli/index.ts Fixes --filter-sphere numeric parsing to avoid accidentally using the array index as a minimum bound.
test/cli.test.mjs Adds regression tests that spawn the CLI and validate --filter-sphere accepts small and negative coordinates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/cli.test.mjs Outdated
Comment thread test/cli.test.mjs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@willeastcott willeastcott merged commit c2ba389 into main May 17, 2026
3 checks passed
@willeastcott willeastcott deleted the fix-filter-sphere-cli-parsing branch May 17, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--filter-sphere parses array index as parseNumber min-bound, breaks any coordinate < array index

2 participants