2 var parse = require('spdx-expression-parse')
3 var assert = require('assert')
6 left: { license: 'LGPL-2.1' },
9 left: { license: 'BSD-3-Clause' },
11 right: { license: 'MIT' } } }
14 parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'),
18 left: { license: 'MIT' },
25 right: { license: 'BSD-3-Clause' } } }
28 parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'),
31 // We handle all the bare SPDX license and exception ids as well.
32 require('spdx-license-ids').forEach(function(id) {
36 require('spdx-exceptions').forEach(function(e) {
38 parse(id + ' WITH ' + e),
39 { license: id, exception: e }) }) })
44 [The Software Package Data Exchange (SPDX) specification](http://spdx.org) is the work of the [Linux Foundation](http://www.linuxfoundation.org) and its contributors, and is licensed under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation.