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

Function normalizeLocalVault

apps/desktop/src/main/vault.ts:357–372  ·  view source on GitHub ↗
(candidate: unknown)

Source from the content-addressed store, hash-verified

355 }
356 }
357 const normalizeLocalVault = (candidate: unknown): PersistedLocalVault | null => {
358 if (!candidate || typeof candidate !== 'object') return null
359 const value = candidate as Record<string, unknown>
360 const rawRoot = typeof value.root === 'string' ? value.root.trim() : ''
361 if (!rawRoot) return null
362 const root = path.resolve(rawRoot)
363 const name =
364 typeof value.name === 'string' && value.name.trim()
365 ? value.name.trim()
366 : path.basename(root)
367 const lastOpenedAt =
368 typeof value.lastOpenedAt === 'number' && Number.isFinite(value.lastOpenedAt)
369 ? value.lastOpenedAt
370 : 0
371 return { root, name, lastOpenedAt }
372 }
373 const legacyRemoteWorkspace =
374 candidate.remoteWorkspace &&
375 typeof candidate.remoteWorkspace === 'object' &&

Callers 1

normalizePersistedConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected