formacao
This commit is contained in:
+1
-2
@@ -5,13 +5,12 @@ const packageCache = new Map();
|
||||
function findNearestPackageData(basedir) {
|
||||
const originalBasedir = basedir;
|
||||
while (basedir) {
|
||||
var _tryStatSync;
|
||||
const cached = getCachedData(packageCache, basedir, originalBasedir);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const pkgPath = join(basedir, "package.json");
|
||||
if ((_tryStatSync = tryStatSync(pkgPath)) === null || _tryStatSync === void 0 ? void 0 : _tryStatSync.isFile()) {
|
||||
if (tryStatSync(pkgPath)?.isFile()) {
|
||||
const pkgData = JSON.parse(stripBomTag(fs.readFileSync(pkgPath, "utf8")));
|
||||
if (packageCache) {
|
||||
setCacheData(packageCache, pkgData, basedir, originalBasedir);
|
||||
|
||||
Reference in New Issue
Block a user