securityos/node_modules/next/dist/esm/lib/find-root.js

17 lines
424 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import { dirname } from "path";
import findUp from "next/dist/compiled/find-up";
export function findRootLockFile(cwd) {
return findUp.sync([
"pnpm-lock.yaml",
"package-lock.json",
"yarn.lock"
], {
cwd
});
}
export function findRootDir(cwd) {
const lockFile = findRootLockFile(cwd);
return lockFile ? dirname(lockFile) : undefined;
}
//# sourceMappingURL=find-root.js.map