Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.2 to 1.2.3

48

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

@@ -24,7 +24,7 @@ exports.getPackageJsonPath = getPackageJsonPath;

* @param {String} modulePath the relative or absolute path to a JS module file
* @return {String} the full path to the package.json file (with native path
* @return {String} the full path to the package.json file (with native path
* separators)
*/
function getPackageJsonPath(modulePath) {
return _path2.default.join(getPackageDir(modulePath), 'package.json');
return _path2.default.join(getPackageDir(modulePath), 'package.json');
}

@@ -35,33 +35,33 @@

* @param {String} modulePath the relative or absolute path to a JS module file
* @return {String} the full path to the package directory (with native path
* @return {String} the full path to the package directory (with native path
* separators)
*/
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.2",
"version": "1.2.3",
"description": "Utility library for Liferay NPM Build Tools.",

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

@@ -9,7 +9,7 @@ import fs from 'fs';

* @param {String} modulePath the relative or absolute path to a JS module file
* @return {String} the full path to the package.json file (with native path
* @return {String} the full path to the package.json file (with native path
* separators)
*/
export function getPackageJsonPath(modulePath) {
return path.join(getPackageDir(modulePath), 'package.json');
return path.join(getPackageDir(modulePath), 'package.json');
}

@@ -20,32 +20,34 @@

* @param {String} modulePath the relative or absolute path to a JS module file
* @return {String} the full path to the package directory (with native path
* @return {String} the full path to the package directory (with native path
* separators)
*/
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