Socket
Socket
Sign inDemoInstall

liferay-npm-build-tools-common

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liferay-npm-build-tools-common - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

44

lib/packages.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});

@@ -28,3 +28,3 @@ exports.getPackageJsonPath = getPackageJsonPath;

function getPackageJsonPath(modulePath) {
return _path2.default.join(getPackageDir(modulePath), 'package.json');
return _path2.default.join(getPackageDir(modulePath), 'package.json');
}

@@ -39,29 +39,29 @@

function getPackageDir(modulePath) {
var absModulePath = _path2.default.resolve(modulePath);
var dir = packageDirCache[absModulePath];
var absModulePath = _path2.default.resolve(modulePath);
var dir = packageDirCache[absModulePath];
if (!dir) {
dir = absModulePath;
var found = false;
if (!dir) {
dir = absModulePath;
var found = false;
while (!found) {
try {
_fs2.default.statSync(_path2.default.join(dir, 'package.json'));
found = true;
} catch (err) {
var dirname = _path2.default.dirname(dir);
while (!found) {
try {
_fs2.default.statSync(_path2.default.join(dir, 'package.json'));
found = true;
} catch (err) {
var dirname = _path2.default.dirname(dir);
if (dirname == dir) {
throw new Error('Cannot find package.json for file: ' + modulePath);
}
if (dirname == dir) {
throw new Error('Cannot find package.json for file: ' + modulePath);
}
dir = dirname;
}
}
dir = dirname;
}
}
packageDirCache[absModulePath] = dir;
}
packageDirCache[absModulePath] = dir;
}
return dir;
return dir;
}
//# sourceMappingURL=packages.js.map
{
"name": "liferay-npm-build-tools-common",
"version": "1.2.1",
"version": "1.2.2",
"description": "Utility library for Liferay NPM Build Tools.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -13,3 +13,3 @@ import fs from 'fs';

export function getPackageJsonPath(modulePath) {
return path.join(getPackageDir(modulePath), 'package.json');
return path.join(getPackageDir(modulePath), 'package.json');
}

@@ -24,30 +24,28 @@

export function getPackageDir(modulePath) {
let absModulePath = path.resolve(modulePath);
let dir = packageDirCache[absModulePath];
let absModulePath = path.resolve(modulePath);
let dir = packageDirCache[absModulePath];
if (!dir) {
dir = absModulePath;
let found = false;
if (!dir) {
dir = absModulePath;
let found = false;
while (!found) {
try {
fs.statSync(path.join(dir, 'package.json'));
found = true;
} catch (err) {
const dirname = path.dirname(dir);
while (!found) {
try {
fs.statSync(path.join(dir, 'package.json'));
found = true;
} catch (err) {
const dirname = path.dirname(dir);
if (dirname == dir) {
throw new Error(
'Cannot find package.json for file: ' + modulePath,
);
}
if (dirname == dir) {
throw new Error('Cannot find package.json for file: ' + modulePath);
}
dir = dirname;
}
}
dir = dirname;
}
}
packageDirCache[absModulePath] = dir;
}
packageDirCache[absModulePath] = dir;
}
return dir;
return dir;
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc