fix(validation): add Windows reserved name validation and version format edge cases

- Fixed version regex to accept -N suffix (e.g., 6.6.80-0)
- Added .trim() to version input for whitespace handling
- Added Windows reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9) validation
- Updated binary-service, variant-service, and validation-service with checks
This commit is contained in:
kaitranntt committed 2026-01-05 00:00:58 -05:00
1 parent 3cdf42c2be
commit ae1847d901
5 files changed
+55 -6

No files matched your search

+4 -1
View File
@@ -5,7 +5,7 @@
* Extracted from api-command.ts for reuse and testability.
*/
import { isReservedName } from '../../config/reserved-names';
import { isReservedName, isWindowsReservedName } from '../../config/reserved-names';
/**
* Validate API profile name
@@ -24,6 +24,9 @@ export function validateApiName(name: string): string | null {
if (isReservedName(name)) {
return `'${name}' is a reserved name`;
}
if (isWindowsReservedName(name)) {
return `'${name}' is a Windows reserved device name and cannot be used`;
}
return null;
}