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

spdx-expression-parse

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spdx-expression-parse - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

AUTHORS

7

index.js

@@ -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

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