Issue Description
Summary
The current platform validation works correctly for exact matches, but there are a few edge cases and improvements that could make it more robust and developer-friendly.
Current Issues
1. Case sensitivity
Platform validation currently fails for values like:
['GitHub']
['GITHUB']
because validation only accepts lowercase exact matches.
### 2. Whitespace handling
Inputs containing leading/trailing whitespace fail validation:
[' github ']
### 3. Duplicate validation behavior
Invalid duplicated values can produce multiple errors:
['abc', 'abc']
Current output:
Unknown platform
Duplicate platform
This may create noisy validation results.
###4. Missing platform type safety
PLATFORMS is currently inferred as string[], which misses:
autocomplete support
compile-time validation
stricter platform typing
Proposed Changes
Normalize platform input using:
trim()
toLowerCase()
Add typed platform constants using as const
Introduce a Platform type
Improve duplicate validation flow
Optionally skip duplicate checks for invalid entries
###Expected Benefits
Better UX for user input
More resilient validation
Stronger TypeScript support
Cleaner error reporting
- enhancement
- typescript
- validation
- good first issue
```bash
fix/platform-validation-normalization
Issue Description
Summary
The current platform validation works correctly for exact matches, but there are a few edge cases and improvements that could make it more robust and developer-friendly.
Current Issues
1. Case sensitivity
Platform validation currently fails for values like: