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

Function validateMoveNoteTarget

packages/app-core/src/lib/move-note.ts:48–56  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

46}
47
48export function validateMoveNoteTarget(value: string): string | null {
49 const normalized = normalizeMoveTarget(value)
50 if (!normalized) return 'Folder path required'
51 const [top] = normalized.split('/')
52 if (top !== 'inbox' && top !== 'archive') {
53 return 'Top-level folder must be inbox or archive'
54 }
55 return null
56}
57
58export function parseMoveNoteTarget(value: string): MoveNoteDestination {
59 const normalized = normalizeMoveTarget(value)

Callers 1

moveActiveNoteFunction · 0.90

Calls 1

normalizeMoveTargetFunction · 0.85

Tested by

no test coverage detected