Skip to content
This repository was archived by the owner on May 25, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/utils/validateMarketId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const MARKET_ID_RE = /^[a-zA-Z0-9_-]{6,128}$/

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

Copy link
Copy Markdown

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

}