standardlint
Version:
Extensible standards linter and auditor.
12 lines (10 loc) • 342 B
JavaScript
// src/utils/exists.ts
import fs from "node:fs";
import path from "node:path";
function exists(basePath, filePath = "", filetreePaths) {
const fullPath = path.join(basePath, filePath);
return filetreePaths && filetreePaths.length > 0 ? filetreePaths.includes(fullPath.replace("./", "")) : fs.existsSync(fullPath);
}
export {
exists
};