Icard/angular-clarity-master(work.../node_modules/karma/lib/utils/file-utils.js

26 lines
419 B
JavaScript
Raw Permalink Normal View History

2024-07-16 14:55:36 +00:00
'use strict'
const fs = require('graceful-fs')
const FileUtils = {
readFile (path) {
return fs.readFileSync(path).toString()
},
saveFile (path, content) {
fs.writeFileSync(path, content)
},
copyFile (src, dest) {
FileUtils.saveFile(dest, FileUtils.readFile(src))
},
removeFileIfExists (src) {
if (fs.existsSync(src)) {
fs.unlinkSync(src)
}
}
}
module.exports = FileUtils