MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / validateModeSlug

Function validateModeSlug

src/services/rules/rules.ts:357–363  ·  view source on GitHub ↗
(modeSlug: string)

Source from the content-addressed store, hash-verified

355}
356
357function validateModeSlug(modeSlug: string): string {
358 if (!/^[a-zA-Z0-9_-]+$/.test(modeSlug)) {
359 throw new Error("Invalid mode slug")
360 }
361
362 return modeSlug
363}
364
365function assertPathInsideDirectory(filePath: string, directoryPath: string): void {
366 if (!isPathInsideDirectory(path.resolve(filePath), path.resolve(directoryPath))) {

Callers 1

getTargetRuleDirectoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected