Something went wrong. Try again.
A local-first note taking app
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021import type { DirectoryEntry, HabitatUri } from '../types';
/** * Get the plain URI without any version (head) suffix. * Habitat URIs are `at://did/collection/rkey` — no heads fragment. * This is a no-op for Habitat URIs but kept for API parity with pushwork. */export function getPlainUri(uri: HabitatUri): HabitatUri { return uri;}
/** * Find an entry by name in a directory's `docs` array. */export function findFileInDirectoryHierarchy( docs: DirectoryEntry[], name: string,): DirectoryEntry | null { return docs.find((entry) => entry.name === name) ?? null;}