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

Function sanitizeForPersist

apps/desktop/src/main/vault.ts:539–556  ·  view source on GitHub ↗
(cfg: PersistedConfig)

Source from the content-addressed store, hash-verified

537}
538
539function sanitizeForPersist(cfg: PersistedConfig): PersistedConfig {
540 const normalized = normalizePersistedConfig(cfg)
541 return {
542 ...normalized,
543 remoteWorkspace: normalized.remoteWorkspace
544 ? {
545 baseUrl: normalized.remoteWorkspace.baseUrl
546 }
547 : null,
548 remoteWorkspaceProfiles: normalized.remoteWorkspaceProfiles.map((profile) => ({
549 id: profile.id,
550 name: profile.name,
551 baseUrl: profile.baseUrl,
552 vaultPath: profile.vaultPath,
553 lastConnectedAt: profile.lastConnectedAt
554 }))
555 }
556}
557
558const CONFIG_TMP_SUFFIX_RE = /\.\d+\.\d+\.tmp$/
559

Callers 1

saveConfigFunction · 0.85

Calls 1

normalizePersistedConfigFunction · 0.85

Tested by

no test coverage detected