MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / clipToMaximum

Function clipToMaximum

src/lib/util.ts:27–30  ·  view source on GitHub ↗
(input: string, maxLength: number)

Source from the content-addressed store, hash-verified

25 * Clip the input string to the maximum length, using ellipses if it is too long.
26 */
27export const clipToMaximum = (input: string, maxLength: number): string =>
28 input.length > maxLength
29 ? `${input.slice(0, maxLength - 3)}...`
30 : input
31
32/**
33 * Returns a string with any non-word characters (anything but letters, numbers or the underscore)

Callers 5

appLinksDefSummarizeFunction · 0.85
arrayDefFunction · 0.85
checkboxDefFunction · 0.85
selectDefFunction · 0.85
util.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected