MCPcopy
hub / github.com/wandb/openui / downloadStringAsFile

Function downloadStringAsFile

frontend/src/lib/utils.ts:34–48  ·  view source on GitHub ↗
(
	content: string,
	mimeType: string,
	fileName: string
)

Source from the content-addressed store, hash-verified

32}
33
34export function downloadStringAsFile(
35 content: string,
36 mimeType: string,
37 fileName: string
38) {
39 const blob = new Blob([content], { type: mimeType })
40 const url = URL.createObjectURL(blob)
41 const a = document.createElement('a')
42 a.href = url
43 a.download = fileName
44 document.body.append(a)
45 a.click()
46 a.remove()
47 URL.revokeObjectURL(url)
48}
49
50export function useIntersectionObserver(
51 elementRef: React.RefObject<Element>,

Callers 1

ChatFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected