MCPcopy Create free account
hub / github.com/algorithm-visualizer/algorithm-visualizer / refineGist

Function refineGist

src/common/util.js:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9const extension = fileName => /(?:\.([^.]+))?$/.exec(fileName)[1];
10
11const refineGist = gist => {
12 const gistId = gist.id;
13 const title = gist.description;
14 delete gist.files['algorithm-visualizer'];
15 const { login, avatar_url } = gist.owner;
16 const files = Object.values(gist.files).map(file => ({
17 name: file.filename,
18 content: file.content,
19 contributors: [{ login, avatar_url }],
20 }));
21 return { login, gistId, title, files };
22};
23
24const createFile = (name, content, contributors) => ({ name, content, contributors });
25

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected