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

Function resolveStorageKeyFromRawFile

apps/sim/lib/uploads/utils/file-utils.ts:679–696  ·  view source on GitHub ↗
(file: RawFileInput)

Source from the content-addressed store, hash-verified

677}
678
679function resolveStorageKeyFromRawFile(file: RawFileInput): string | null {
680 if (file.key) {
681 return file.key
682 }
683
684 if (file.path) {
685 if (isUrlLike(file.path)) {
686 return isInternalFileUrl(file.path) ? extractStorageKey(file.path) : null
687 }
688 return file.path
689 }
690
691 if (file.url) {
692 return isInternalFileUrl(file.url) ? extractStorageKey(file.url) : null
693 }
694
695 return null
696}
697
698function resolveInternalFileUrl(file: RawFileInput): string {
699 if (file.url && isInternalFileUrl(file.url)) {

Callers 1

convertToUserFileFunction · 0.85

Calls 3

isInternalFileUrlFunction · 0.85
extractStorageKeyFunction · 0.85
isUrlLikeFunction · 0.70

Tested by

no test coverage detected