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

Function isCompleteUserFile

apps/sim/lib/uploads/utils/file-utils.ts:640–649  ·  view source on GitHub ↗

* Type guard to check if a RawFileInput has all UserFile required properties

(file: RawFileInput)

Source from the content-addressed store, hash-verified

638 * Type guard to check if a RawFileInput has all UserFile required properties
639 */
640function isCompleteUserFile(file: RawFileInput): file is UserFile {
641 return (
642 typeof file.id === 'string' &&
643 typeof file.name === 'string' &&
644 typeof file.url === 'string' &&
645 typeof file.size === 'number' &&
646 typeof file.type === 'string' &&
647 typeof file.key === 'string'
648 )
649}
650
651function isUrlLike(value: string): boolean {
652 return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/')

Callers 1

convertToUserFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected