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

Function rewritePath

packages/app-core/src/store.ts:6380–6381  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

6378 const oldPrefix = `${folder}/${oldSubpath}/`
6379 const newPrefix = `${folder}/${newSubpath}/`
6380 const rewritePath = (p: string): string =>
6381 p.startsWith(oldPrefix) ? newPrefix + p.slice(oldPrefix.length) : p
6382
6383 const notes = get().notes.map((n) =>
6384 n.path.startsWith(oldPrefix) ? { ...n, path: rewritePath(n.path) } : n

Callers 1

store.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected