MCPcopy Create free account
hub / github.com/kentcdodds/kcd-scripts / ifFile

Function ifFile

src/utils.js:67–68  ·  view source on GitHub ↗
(files, t, f)

Source from the content-addressed store, hash-verified

65const toPOSIX = p => p.split(path.sep).join(path.posix.sep)
66const hasFile = (...p) => fs.existsSync(fromRoot(...p))
67const ifFile = (files, t, f) =>
68 arrify(files).some(file => hasFile(file)) ? t : f
69
70const hasPkgProp = props => arrify(props).some(prop => has(pkg, prop))
71

Callers

nothing calls this directly

Calls 1

hasFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…