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

Function resolveFilePathsFromInput

apps/sim/blocks/blocks/file.ts:32–45  ·  view source on GitHub ↗
(fileInput: unknown)

Source from the content-addressed store, hash-verified

30}
31
32const resolveFilePathsFromInput = (fileInput: unknown): string[] => {
33 if (!fileInput) {
34 return []
35 }
36
37 if (Array.isArray(fileInput)) {
38 return fileInput
39 .map((file) => resolveFilePathFromInput(file))
40 .filter((path): path is string => Boolean(path))
41 }
42
43 const resolved = resolveFilePathFromInput(fileInput)
44 return resolved ? [resolved] : []
45}
46
47const resolveHttpFileUrl = (value: unknown): string => {
48 const fileUrl = typeof value === 'string' ? value.trim() : ''

Callers 1

file.tsFile · 0.85

Calls 1

resolveFilePathFromInputFunction · 0.85

Tested by

no test coverage detected