spdx-expression-parse
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,4 +0,5 @@ | ||
var parser = require('./parser.generated.js').parser | ||
var parser = require('./parser').parser | ||
module.exports = function(argument) { | ||
return parser.parse(argument) } | ||
module.exports = function (argument) { | ||
return parser.parse(argument) | ||
} |
{ | ||
"name": "spdx-expression-parse", | ||
"description": "parse SPDX license expressions", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (http://kemitchell.com)", | ||
"dependencies": { | ||
"spdx-exceptions": "^1.0.4", | ||
"spdx-license-ids": "^1.0.0" | ||
}, | ||
"files": [ | ||
"AUTHORS", | ||
"index.js", | ||
"parser.js" | ||
], | ||
"devDependencies": { | ||
@@ -14,3 +15,5 @@ "defence-cli": "^1.0.1", | ||
"replace-require-self": "^1.0.0", | ||
"uglify-js": "^2.4.24" | ||
"spdx-exceptions": "^1.0.4", | ||
"spdx-license-ids": "^1.0.0", | ||
"standard": "^8.0.0" | ||
}, | ||
@@ -30,3 +33,4 @@ "keywords": [ | ||
"scripts": { | ||
"prepublish": "node generate-parser.js | uglifyjs > parser.generated.js", | ||
"lint": "standard", | ||
"prepublish": "node generate-parser.js > parser.js", | ||
"pretest": "npm run prepublish", | ||
@@ -33,0 +37,0 @@ "test": "defence -i javascript README.md | replace-require-self | node" |
@@ -5,37 +5,38 @@ ```javascript | ||
var firstAST = { | ||
left: { license: 'LGPL-2.1' }, | ||
conjunction: 'or', | ||
right: { | ||
left: { license: 'BSD-3-Clause' }, | ||
conjunction: 'and', | ||
right: { license: 'MIT' } } } | ||
assert.deepEqual( | ||
parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'), | ||
firstAST) | ||
{ | ||
left: {license: 'LGPL-2.1'}, | ||
conjunction: 'or', | ||
right: { | ||
left: {license: 'BSD-3-Clause'}, | ||
conjunction: 'and', | ||
right: {license: 'MIT'} | ||
} | ||
} | ||
) | ||
var secondAST = { | ||
left: { license: 'MIT' }, | ||
conjunction: 'and', | ||
right: { | ||
left: { | ||
license: 'LGPL-2.1', | ||
plus: true }, | ||
conjunction: 'and', | ||
right: { license: 'BSD-3-Clause' } } } | ||
assert.deepEqual( | ||
parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), | ||
secondAST) | ||
{ | ||
left: {license: 'MIT'}, | ||
conjunction: 'and', | ||
right: { | ||
left: {license: 'LGPL-2.1', plus: true}, | ||
conjunction: 'and', | ||
right: {license: 'BSD-3-Clause'} | ||
} | ||
} | ||
) | ||
// We handle all the bare SPDX license and exception ids as well. | ||
require('spdx-license-ids').forEach(function(id) { | ||
assert.deepEqual( | ||
parse(id), | ||
{ license: id }) | ||
require('spdx-exceptions').forEach(function(e) { | ||
require('spdx-license-ids').forEach(function (id) { | ||
assert.deepEqual(parse(id), {license: id}) | ||
require('spdx-exceptions').forEach(function (e) { | ||
assert.deepEqual( | ||
parse(id + ' WITH ' + e), | ||
{ license: id, exception: e }) }) }) | ||
{license: id, exception: e} | ||
) | ||
}) | ||
}) | ||
``` | ||
@@ -42,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
42506
0
6
1350
1
46
6
1
- Removedspdx-exceptions@^1.0.4
- Removedspdx-license-ids@^1.0.0
- Removedspdx-exceptions@1.0.5(transitive)
- Removedspdx-license-ids@1.2.2(transitive)