MCPcopy
hub / github.com/MithrilJS/mithril.js / isFile

Function isFile

bundler/bundle.js:10–12  ·  view source on GitHub ↗
(filepath)

Source from the content-addressed store, hash-verified

8 try {return fs.readFileSync(filepath, "utf8")} catch (e) {throw new Error("File does not exist: " + filepath)}
9}
10function isFile(filepath) {
11 try {return fs.statSync(filepath).isFile()} catch (e) {return false}
12}
13function parse(file) {
14 var json = read(file)
15 try {return JSON.parse(json)} catch (e) {throw new Error("invalid JSON: " + json)}

Callers 2

resolveFunction · 0.85
runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected