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

Function removeFolderKeyMap

packages/app-core/src/lib/vault-layout.ts:723–736  ·  view source on GitHub ↗
(
  map: Record<string, T>,
  folder: NoteFolder,
  subpath: string
)

Source from the content-addressed store, hash-verified

721}
722
723function removeFolderKeyMap<T>(
724 map: Record<string, T>,
725 folder: NoteFolder,
726 subpath: string
727): Record<string, T> {
728 const next: Record<string, T> = {}
729 const exactKey = folderIconKey(folder, subpath)
730 const prefix = `${exactKey}/`
731 for (const [key, value] of Object.entries(map)) {
732 if (key === exactKey || key.startsWith(prefix)) continue
733 next[key] = value
734 }
735 return next
736}
737
738function duplicateFolderKeyMap<T>(
739 map: Record<string, T>,

Callers 1

removeFolderColorsFunction · 0.85

Calls 1

folderIconKeyFunction · 0.70

Tested by

no test coverage detected