MCPcopy Create free account
hub / github.com/Noumena-Network/code / getDirectoryNames

Function getDirectoryNames

src/hooks/fileSuggestions.ts:454–458  ·  view source on GitHub ↗
(files: string[])

Source from the content-addressed store, hash-verified

452 * @returns An array of unique directory names with a trailing separator
453 */
454export function getDirectoryNames(files: string[]): string[] {
455 const directoryNames = new Set<string>()
456 collectDirectoryNames(files, 0, files.length, directoryNames)
457 return [...directoryNames].map(d => d + path.sep)
458}
459
460/**
461 * Async variant: yields every ~10k files so 270k+ file lists don't block

Callers

nothing calls this directly

Calls 1

collectDirectoryNamesFunction · 0.85

Tested by

no test coverage detected