(value: string)
| 138 | } |
| 139 | |
| 140 | export function validateBasePath(value: string): string { |
| 141 | if (value === '') return value; |
| 142 | if (!value.startsWith('/')) throw new Error(`basePath must start with /: ${value}`); |
| 143 | if (value.endsWith('/')) throw new Error(`basePath must not end with /: ${value}`); |
| 144 | if (value.includes('//')) throw new Error(`basePath must not contain //: ${value}`); |
| 145 | if (value.includes('"')) throw new Error(`basePath must not contain double quotes: ${value}`); |
| 146 | if (value.includes('\\')) throw new Error(`basePath must not contain backslashes: ${value}`); |
| 147 | return value; |
| 148 | } |
| 149 | |
| 150 | function validateVersion(value: string): string { |
| 151 | if (!/^[\w+.-]+$/.test(value)) |
no outgoing calls
no test coverage detected