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

Function truncate

apps/desktop/src/cli/format.ts:27–30  ·  view source on GitHub ↗
(value: string, max: number)

Source from the content-addressed store, hash-verified

25}
26
27export function truncate(value: string, max: number): string {
28 if (value.length <= max) return value
29 return value.slice(0, max - 1).trimEnd() + '…'
30}
31
32export function formatRelativeAge(updatedAt: number): string {
33 const diff = Date.now() - updatedAt

Callers 4

cmdTaskListFunction · 0.85
cmdCaptureFunction · 0.85
cmdSearchFunction · 0.85
emitCreatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected