MCPcopy
hub / github.com/andremichelle/openDAW / nonEmpty

Function nonEmpty

packages/lib/std/src/strings.ts:7–7  ·  view source on GitHub ↗
(str: Maybe<string>)

Source from the content-addressed store, hash-verified

5 .replace(/-([a-z])/g, (g: string) => g[1].toUpperCase())
6
7 export const nonEmpty = (str: Maybe<string>): str is string => isDefined(str) && str.trim().length > 0
8
9 export const fallback = (value: Maybe<string>, fallback: string): string => nonEmpty(value) ? value : fallback
10

Callers 1

fallbackFunction · 0.85

Calls 1

isDefinedFunction · 0.90

Tested by

no test coverage detected