fix(iterate): reject non-decimal numeric interval values#807
Open
kairoships-ui wants to merge 1 commit into
Open
fix(iterate): reject non-decimal numeric interval values#807kairoships-ui wants to merge 1 commit into
kairoships-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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