MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / parseFolderFlag

Function parseFolderFlag

apps/desktop/src/cli/commands/notes.ts:37–45  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

35const VALID_FOLDERS: NoteFolder[] = ['inbox', 'quick', 'archive', 'trash']
36
37function parseFolderFlag(value: string | undefined): NoteFolder | undefined {
38 if (value == null) return undefined
39 if (!VALID_FOLDERS.includes(value as NoteFolder)) {
40 throw new Error(
41 `--folder must be one of ${VALID_FOLDERS.join(', ')} (got "${value}")`
42 )
43 }
44 return value as NoteFolder
45}
46
47export async function cmdList(vault: string, args: ParsedArgs): Promise<void> {
48 const folder = parseFolderFlag(getString(args, 'folder'))

Callers 3

cmdListFunction · 0.85
cmdCreateFunction · 0.85
cmdMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected