MCPcopy Index your code
hub / github.com/massCodeIO/massCode / findFolderId

Function findFolderId

src/main/import/notes/persist.ts:12–26  ·  view source on GitHub ↗
(
  folders: ReturnType<
    ReturnType<typeof useNotesStorage>['folders']['getFolders']
  >,
  parentId: number | null,
  name: string,
)

Source from the content-addressed store, hash-verified

10} from '../snippets/normalizers'
11
12function findFolderId(
13 folders: ReturnType<
14 ReturnType<typeof useNotesStorage>['folders']['getFolders']
15 >,
16 parentId: number | null,
17 name: string,
18): number | null {
19 const folder = folders.find(
20 item =>
21 item.parentId === parentId
22 && item.name.toLowerCase() === name.toLowerCase(),
23 )
24
25 return folder?.id ?? null
26}
27
28function getUniqueFolderName(
29 folders: ReturnType<

Callers 1

ensureFolderPathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected