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

Function parseMultiValue

apps/sim/connectors/utils.ts:71–96  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

69 * branch on `values.length` for single vs multi behavior.
70 */
71export function parseMultiValue(value: unknown): string[] {
72 if (Array.isArray(value)) {
73 const seen = new Set<string>()
74 const out: string[] = []
75 for (const item of value) {
76 if (typeof item !== 'string') continue
77 const trimmed = item.trim()
78 if (!trimmed || seen.has(trimmed)) continue
79 seen.add(trimmed)
80 out.push(trimmed)
81 }
82 return out
83 }
84 if (typeof value === 'string') {
85 const seen = new Set<string>()
86 const out: string[] = []
87 for (const part of value.split(',')) {
88 const trimmed = part.trim()
89 if (!trimmed || seen.has(trimmed)) continue
90 seen.add(trimmed)
91 out.push(trimmed)
92 }
93 return out
94 }
95 return []
96}
97
98/**
99 * Escapes a value for safe interpolation into a Google Drive `q` query string,

Callers 15

webflow.tsFile · 0.90
google-forms.tsFile · 0.90
confluence.tsFile · 0.90
linear.tsFile · 0.90
buildSearchQueryFunction · 0.90
gmail.tsFile · 0.90
google-calendar.tsFile · 0.90
parseUsernamesFunction · 0.90
resolveBoardIdsFunction · 0.90
microsoft-teams.tsFile · 0.90
buildQueryFunction · 0.90
google-drive.tsFile · 0.90

Calls 2

addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected