etherpad-lite/src/node/utils/path_exists.js
2021-01-25 22:53:11 -05:00

16 lines
276 B
JavaScript

'use strict';
const fs = require('fs');
const check = (path) => {
const existsSync = fs.statSync || fs.existsSync || path.existsSync;
let result;
try {
result = existsSync(path);
} catch (e) {
result = false;
}
return result;
};
module.exports = check;