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

Function extractEmbeddedFileRefs

apps/sim/lib/uploads/utils/embedded-image-ref.ts:62–73  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

60 * bundler share one grammar.
61 */
62export function extractEmbeddedFileRefs(content: string): { keys: string[]; ids: string[] } {
63 const keys = new Set<string>()
64 const ids = new Set<string>()
65 for (const match of content.matchAll(EMBED_URL_RE)) {
66 const ref = extractEmbeddedFileRef(match[0])
67 if (!ref) continue
68 if ('key' in ref) keys.add(ref.key)
69 else ids.add(ref.fileId)
70 if (keys.size + ids.size >= MAX_EMBEDDED_IMAGES) break
71 }
72 return { keys: [...keys], ids: [...ids] }
73}

Callers 3

extractEmbeddedImageIdsFunction · 0.90
extractEmbeddedImageKeysFunction · 0.90

Calls 2

extractEmbeddedFileRefFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected