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

Function isUserFile

apps/sim/lib/core/utils/user-file.ts:17–30  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

15 * Checks if a value matches the minimal UserFile shape.
16 */
17export function isUserFile(value: unknown): value is UserFileLike {
18 if (!value || typeof value !== 'object') {
19 return false
20 }
21
22 const candidate = value as Record<string, unknown>
23
24 return (
25 typeof candidate.id === 'string' &&
26 typeof candidate.key === 'string' &&
27 typeof candidate.url === 'string' &&
28 typeof candidate.name === 'string'
29 )
30}
31
32/**
33 * Checks if a value matches the full UserFile metadata shape.

Callers 5

redactApiKeysFunction · 0.90
filterUserFileFunction · 0.90
processFileDataMethod · 0.90
isUserFileWithMetadataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected