UNPKG

standardlint

Version:
12 lines (10 loc) 342 B
// 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 };