fix(iterate): reject non-decimal numeric interval values#807
fix(iterate): reject non-decimal numeric interval values#807kairoships-ui wants to merge 1 commit into
Conversation
Number() coerces scientific (1e2), hexadecimal (0x10), binary/octal, signed (+60), and whitespace-padded strings into numbers, so those were incorrectly accepted as --interval values. Guard parsePositiveSafeInteger with a strict ^\d+$ decimal check before Number(), and add regression coverage for the non-decimal forms. Closes profullstack#803 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
11 similar comments
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Summary
parsePositiveSafeIntegerusedNumber(value), which coerces scientific (1e2-> 100), hexadecimal (0x10-> 16), binary/octal, signed (+60), and whitespace-padded strings into numbers. Those were incorrectly accepted as--intervalvalues.^\d+$decimal guard beforeNumber(), keeping plain positive safe-integer parsing unchanged.1e2,0x10,0b10,0o10,+60,60,60,1_000).Verification
vitest run packages/cli/src/commands/iterate.test.ts-> 26 passed (8 new)tsc -p packages/cli/tsconfig.json --noEmit-> no new errors in the cli packagegit diff --check-> cleanCloses #803