MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / toggleDir

Function toggleDir

app/composables/useFileTreeState.ts:4–10  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

2 const expanded = useState<Set<string>>(`npmx-file-tree${baseUrl}`, () => new Set<string>())
3
4 function toggleDir(path: string) {
5 if (expanded.value.has(path)) {
6 expanded.value.delete(path)
7 } else {
8 expanded.value.add(path)
9 }
10 }
11
12 function isExpanded(path: string) {
13 return expanded.value.has(path)

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.65

Tested by

no test coverage detected