Skip to content

Reject partial numeric strings in Pharmacode validation - #482

Open
xiehuanyi wants to merge 1 commit into
lindell:masterfrom
xiehuanyi:fix/pharmacode-integer-text-validation-20261011
Open

xiehuanyi wants to merge 1 commit into
lindell:masterfrom
xiehuanyi:fix/pharmacode-integer-text-validation-20261011

Conversation

@xiehuanyi

Copy link
Copy Markdown

Pharmacode validation checks only the range of parseInt(data), so inputs such as 3.5, 3junk, and 3e4 are accepted and encode the value 3 while displaying different text. Pharmacode input is an integer, as described by the project documentation and the Laetus guide linked in the encoder.

Reject non-digit input before the existing range check. Digit-only leading-zero values remain accepted, as do the existing 3 and 131070 boundaries. Regression cases cover decimals, numeric suffixes, scientific notation and whitespace, including final line terminators.

The new regression fails on the original code. Validation: the full npm test suite passes with 110 tests on Node 18 and the repository's canvas dependency. The changed source passes ESLint with the repository config's obsolete predef key normalized outside the patch. The existing gulp lint command is blocked by that invalid config, and normalized whole-source lint reports unrelated existing errors. git diff --check passes. No generated bin/dist or dependency changes are included.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants