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

Function lastSegment

packages/shared-domain/src/databases.ts:42–45  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

40
41const toPosixPath = (p: string): string => p.replace(/\\/g, '/')
42const lastSegment = (p: string): string => {
43 const s = toPosixPath(p)
44 return s.slice(s.lastIndexOf('/') + 1)
45}
46
47/** True when a folder name (or a path's last segment) marks a database folder. */
48export function isFormDirName(nameOrPath: string): boolean {

Callers 2

isFormDirNameFunction · 0.85
formTitleFromDirFunction · 0.85

Calls 1

toPosixPathFunction · 0.85

Tested by

no test coverage detected