MCPcopy
hub / github.com/epicweb-dev/react-performance / writeIfNeeded

Function writeIfNeeded

epicshop/fix.js:111–117  ·  view source on GitHub ↗
(filepath, content)

Source from the content-addressed store, hash-verified

109}
110
111async function writeIfNeeded(filepath, content) {
112 const oldContent = await fs.promises.readFile(filepath, 'utf8')
113 if (oldContent !== content) {
114 await fs.promises.writeFile(filepath, content)
115 }
116 return oldContent !== content
117}
118
119function exists(p) {
120 if (!p) return false

Callers 2

updatePkgNamesFunction · 0.85
updateTsconfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected