@next-boilerplate/cli-helpers
Version:
CLI helper for Next Boilerplate
12 lines (8 loc) • 327 B
JavaScript
;
var path = require('path');
function isPathInCurrentScope(filePath) {
const basePath = process.cwd();
const resolvedPath = path.resolve(basePath, filePath);
return resolvedPath.startsWith(basePath) && path.relative(basePath, resolvedPath) !== "..";
}
exports.isPathInCurrentScope = isPathInCurrentScope;