mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 02:16:27 +00:00
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:
1 parent
3cdf42c2be
commit
ae1847d901
5 files changed
+55
-6
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user