Socket
Socket
Sign inDemoInstall

snyk-module

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-module - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0

6

lib/index.js

@@ -128,2 +128,8 @@ module.exports = moduleToObject;

if (options.packageManager === 'maven') {
if (str.indexOf(':') === -1) {
throw new Error('invalid Maven package name: ' + str);
}
return module;
}
var valid = validate(module.name);

@@ -130,0 +136,0 @@

2

package.json

@@ -55,3 +55,3 @@ {

},
"version": "1.7.1"
"version": "1.8.0"
}

@@ -127,1 +127,38 @@ var test = require('tap').test;

});
test('Maven modules', function(t) {
var groupId = 'org.apache.httpcomponents';
var artifactId = 'httpcomponents-core';
var packageName = groupId + ':' + artifactId;
t.equal(mod.encode(packageName), groupId + '%3A' + artifactId);
t.deepEqual(mod(packageName, {packageManager: 'maven'}),
{name: packageName, version: '*'});
t.deepEqual(mod(packageName, '3.4.5', {packageManager: 'maven'}),
{name: packageName, version: '3.4.5'});
t.deepEqual(mod(packageName, '3.4.5-SNAPSHOT', {packageManager: 'maven'}),
{name: packageName, version: '3.4.5-SNAPSHOT'});
t.deepEqual(mod(packageName + '@3.4.5', {packageManager: 'maven'}),
{name: packageName, version: '3.4.5'});
try {
mod(groupId, {packageManager: 'maven'});
} catch(e) {
t.equal(e.message, 'invalid Maven package name: ' + groupId);
}
try {
mod(packageName);
} catch(e) {
t.equal(e.message,
'invalid package name: ' +
groupId + ':' + artifactId +
', errors: name can only contain URL-friendly characters');
}
t.end();
});

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