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

Function replaceNoteMeta

packages/app-core/src/store.ts:986–992  ·  view source on GitHub ↗
(notes: NoteMeta[], oldPath: string, next: NoteMeta)

Source from the content-addressed store, hash-verified

984}
985
986function replaceNoteMeta(notes: NoteMeta[], oldPath: string, next: NoteMeta): NoteMeta[] {
987 const idx = notes.findIndex((n) => n.path === oldPath)
988 if (idx === -1) return notes
989 const copy = notes.slice()
990 copy[idx] = next
991 return copy
992}
993
994function mergeNotesPreservingOrder(prev: NoteMeta[], next: NoteMeta[]): NoteMeta[] {
995 const nextByPath = new Map(next.map((n) => [n.path, n] as const))

Callers 1

renameNoteStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected