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 2.0.0-rc.4 to 2.0.0

22

lib/__tests__/imports.test.js

@@ -47,2 +47,24 @@ 'use strict';

});
describe('unrollImportsConfig handles null namespaces correctly', function () {
it('when described the canonical way', function () {
var imports = (0, _imports.unrollImportsConfig)({
'': {
dep: '^1.0.0'
}
});
expect(imports['dep']).toMatchObject({ name: '', version: '^1.0.0' });
});
it('when described the sweet way', function () {
var imports = (0, _imports.unrollImportsConfig)({
dep: {
'/': '^1.0.0'
}
});
expect(imports['dep']).toMatchObject({ name: '', version: '^1.0.0' });
});
});
//# sourceMappingURL=imports.test.js.map

13

lib/imports.js

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -19,4 +19,11 @@ Object.defineProperty(exports, "__esModule", {

Object.keys(importsConfig[namespace]).forEach(function (pkgName) {
var version = importsConfig[namespace][pkgName];
if (pkgName === '/') {
pkgName = namespace;
namespace = '';
}
if (imports[pkgName]) {
throw new Error("Package " + pkgName + " is mapped to more than one import");
throw new Error('Package ' + pkgName + ' is mapped to more than one import');
}

@@ -26,3 +33,3 @@

name: namespace,
version: importsConfig[namespace][pkgName]
version: version
};

@@ -29,0 +36,0 @@ });

{
"name": "liferay-npm-build-tools-common",
"version": "2.0.0-rc.4",
"version": "2.0.0",
"description": "Utility library for Liferay NPM Build Tools.",

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

@@ -45,1 +45,23 @@ import {unrollImportsConfig} from '../imports';

});
describe('unrollImportsConfig handles null namespaces correctly', () => {
it('when described the canonical way', () => {
const imports = unrollImportsConfig({
'': {
dep: '^1.0.0',
},
});
expect(imports['dep']).toMatchObject({name: '', version: '^1.0.0'});
});
it('when described the sweet way', () => {
const imports = unrollImportsConfig({
dep: {
'/': '^1.0.0',
},
});
expect(imports['dep']).toMatchObject({name: '', version: '^1.0.0'});
});
});

@@ -13,2 +13,9 @@ /**

Object.keys(importsConfig[namespace]).forEach(pkgName => {
const version = importsConfig[namespace][pkgName];
if (pkgName === '/') {
pkgName = namespace;
namespace = '';
}
if (imports[pkgName]) {

@@ -22,3 +29,3 @@ throw new Error(

name: namespace,
version: importsConfig[namespace][pkgName],
version,
};

@@ -25,0 +32,0 @@ });

Sorry, the diff of this file is not supported yet

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