MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / trimString

Function trimString

packages/shared/src/utils.ts:138–141  ·  view source on GitHub ↗
(str: string, maxLength: number)

Source from the content-addressed store, hash-verified

136
137/** function that trims too long string */
138export function trimString(str: string, maxLength: number): string {
139 if (str.length <= maxLength) return str
140 return str.slice(0, maxLength) + '…'
141}
142
143export function findIndexById<T extends {id: string}>(array: T[], id: string): number {
144 for (let i = 0; i < array.length; i++) if (array[i]!.id === id) return i

Callers 1

getNodeNameFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…