UNPKG

@next-boilerplate/cli-helpers

Version:
10 lines (7 loc) 289 B
import path from 'path'; function isPathInCurrentScope(filePath) { const basePath = process.cwd(); const resolvedPath = path.resolve(basePath, filePath); return resolvedPath.startsWith(basePath) && path.relative(basePath, resolvedPath) !== ".."; } export { isPathInCurrentScope };