Skip to content

Comments

feat: add market id validator#272

Open
AndersonUece wants to merge 1 commit intoPolymarket:mainfrom
AndersonUece:feat/market-id-validator
Open

feat: add market id validator#272
AndersonUece wants to merge 1 commit intoPolymarket:mainfrom
AndersonUece:feat/market-id-validator

Conversation

@AndersonUece
Copy link

@AndersonUece AndersonUece commented Jan 27, 2026

Added a small validator to catch malformed IDs early instead of failing downstream.


Note

Introduces a simple utility to validate market IDs.

  • Adds validateMarketId in src/utils/validateMarketId.ts enforcing /^[a-zA-Z0-9_-]{6,128}$/ and throwing Error on invalid input

Written by Cursor Bugbot for commit b70f1e8. This will update automatically on new commits. Configure here.

Added a small validator to catch malformed IDs early instead of failing downstream.
@AndersonUece AndersonUece requested a review from a team as a code owner January 27, 2026 15:35
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

export function validateMarketId(value: string): void {
if (!MARKET_ID_RE.test(value)) {
throw new Error('Invalid market id format')
}
Copy link

Choose a reason for hiding this comment

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

Exported validator function is never used

Low Severity

The validateMarketId function is exported but never imported or called anywhere in the codebase. The PR description states it was added to "catch malformed IDs early instead of failing downstream," but no integration with existing code is present. The validator exists in isolation without any consumers.

Fix in Cursor Fix in Web

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