MCPcopy Create free account
hub / github.com/BCsabaEngine/svelteesp32 / validateBasePath

Function validateBasePath

src/commandLine.ts:140–148  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

138}
139
140export 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
150function validateVersion(value: string): string {
151 if (!/^[\w+.-]+$/.test(value))

Callers 3

closeBundleFunction · 0.90
parseArgumentsFunction · 0.85
applyFlagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected