MCPcopy Create free account
hub / github.com/codeaashu/claude-code / formatDirectoryList

Function formatDirectoryList

src/utils/permissions/pathValidation.ts:38–51  ·  view source on GitHub ↗
(directories: string[])

Source from the content-addressed store, hash-verified

36}
37
38export function formatDirectoryList(directories: string[]): string {
39 const dirCount = directories.length
40
41 if (dirCount <= MAX_DIRS_TO_LIST) {
42 return directories.map(dir => `'${dir}'`).join(', ')
43 }
44
45 const firstDirs = directories
46 .slice(0, MAX_DIRS_TO_LIST)
47 .map(dir => `'${dir}'`)
48 .join(', ')
49
50 return `${firstDirs}, and ${dirCount - MAX_DIRS_TO_LIST} more`
51}
52
53/**
54 * Extracts the base directory from a glob pattern for validation.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected