MCPcopy
hub / github.com/vercel/next.js / fileExist

Function fileExist

test/integration/export-404/test/index.test.ts:13–17  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

11const nextConfig = new File(join(appDir, 'next.config.js'))
12
13const fileExist = (path) =>
14 access(path)
15 .then(() => stat(path))
16 .then((stats) => (stats.isFile() ? true : false))
17 .catch(() => false)
18
19// Issue #36855
20// https://github.com/vercel/next.js/issues/36855

Callers 1

index.test.tsFile · 0.70

Calls 4

accessFunction · 0.85
thenMethod · 0.80
isFileMethod · 0.80
catchMethod · 0.45

Tested by

no test coverage detected