MCPcopy Index your code
hub / github.com/simstudioai/sim / firstNonEmpty

Function firstNonEmpty

apps/sim/enrichments/providers.ts:39–46  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

37
38/** Returns the first non-empty string in an array (or `undefined`). */
39export function firstNonEmpty(value: unknown): string | undefined {
40 if (!Array.isArray(value)) return undefined
41 for (const item of value) {
42 const s = str(item)
43 if (s) return s
44 }
45 return undefined
46}
47
48/**
49 * Splits a full name into first / last for providers whose API requires both

Callers 1

phone-number.tsFile · 0.90

Calls 1

strFunction · 0.85

Tested by

no test coverage detected