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

Function readSiblingOrder

apps/desktop/src/main/vault.ts:2446–2455  ·  view source on GitHub ↗
(abs: string)

Source from the content-addressed store, hash-verified

2444}
2445
2446async function readSiblingOrder(abs: string): Promise<number> {
2447 try {
2448 const entries = await fs.readdir(path.dirname(abs), { withFileTypes: true })
2449 const name = path.basename(abs)
2450 const index = entries.findIndex((entry) => entry.name === name)
2451 return index === -1 ? Number.MAX_SAFE_INTEGER : index
2452 } catch {
2453 return Number.MAX_SAFE_INTEGER
2454 }
2455}
2456
2457async function mapLimit<T, U>(
2458 items: T[],

Callers 1

readMetaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected