MCPcopy
hub / github.com/sallar/github-contributions-chart / downloadJSON

Function downloadJSON

src/utils/export.js:23–37  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

21}
22
23export function downloadJSON(data) {
24 try {
25 const dataString = JSON.stringify(data);
26 const dataUrl =
27 "data:text/json;charset=utf-8," + encodeURIComponent(dataString);
28 const a = document.createElement("a");
29 document.body.insertAdjacentElement("beforeend", a);
30 a.download = "contributions.json";
31 a.href = dataUrl;
32 a.click();
33 document.body.removeChild(a);
34 } catch (err) {
35 console.error(err);
36 }
37}
38
39export async function share(canvas) {
40 try {

Callers 1

onDownloadJsonFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected