MCPcopy Create free account
hub / github.com/observablehq/framework / isJsFile

Function isJsFile

test/javascript/parse-test.ts:9–13  ·  view source on GitHub ↗
(inputRoot: string, fileName: string)

Source from the content-addressed store, hash-verified

7import {parseJavaScript} from "../../src/javascript/parse.js";
8
9function isJsFile(inputRoot: string, fileName: string) {
10 if (!fileName.endsWith(".js")) return false;
11 const path = join(inputRoot, fileName);
12 return statSync(path).isFile();
13}
14
15function redactJavaScript({input, ...node}: JavaScriptNode): Omit<JavaScriptNode, "input"> {
16 return node;

Callers 1

runTestsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected