MCPcopy Create free account
hub / github.com/Khan/perseus / getCode

Function getCode

utils/extract-css.js:83–90  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

81 ****************/
82
83const getCode = (filePath) => {
84 const code = fs.readFileSync(filePath, "utf8");
85 const parsedCode = parse(code, {
86 sourceType: "module",
87 plugins: ["jsx", "typescript"],
88 });
89 return {code, parsedCode};
90};
91
92const mapVariables = (parsedCode) => {
93 // Gather variable declarations, both regular and exported.

Callers 2

extract-css.jsFile · 0.85
getImportedValuesFunction · 0.85

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected