Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2universalStack: any
query-paramsnormalizationparsing
Normalize array query params through a shared helper before mapping
Query params that may be string or string[] should pass through a normalize helper before .map(Number) so both single and repeated values work.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | tickerIds: tickerIds.split(',').map(Number); // breaks if array or undefined |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | tickerIds: normalizeArrayParam(tickerIds)?.map(Number); |
Explanation (EN)
Objašnjenje (HR)