MCPcopy Create free account
hub / github.com/027xiguapi/code-box / saveTxt

Function saveTxt

tools.ts:43–49  ·  view source on GitHub ↗
(txt: string, filename?: string)

Source from the content-addressed store, hash-verified

41}
42
43export function saveTxt(txt: string, filename?: string) {
44 if (txt) {
45 const blob = new Blob([txt], { type: "text/plain;charset=utf-8" })
46 filename = filename || "CodeBox-page"
47 saveAs(blob, `${filename}-${dayjs().format("YYYY-MM-DD HH:mm:ss")}.txt`)
48 }
49}
50
51export function saveHtml(dom: Element, filename?: string) {
52 if (dom) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected