UNPKG

@next-boilerplate/cli-helpers

Version:
12 lines (8 loc) 327 B
'use strict'; 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;