]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / validate-npm-package-license / node_modules / spdx-expression-parse / README.md
1 ```javascript
2 var parse = require('spdx-expression-parse')
3 var assert = require('assert')
4
5 var firstAST = {
6   left: { license: 'LGPL-2.1' },
7   conjunction: 'or',
8   right: {
9     left: { license: 'BSD-3-Clause' },
10     conjunction: 'and',
11     right: { license: 'MIT' } } }
12
13 assert.deepEqual(
14   parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'),
15   firstAST)
16
17 var secondAST = {
18   left: { license: 'MIT' },
19   conjunction: 'and',
20   right: {
21     left: {
22           license: 'LGPL-2.1',
23           plus: true },
24     conjunction: 'and',
25     right: { license: 'BSD-3-Clause' } } }
26
27 assert.deepEqual(
28   parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'),
29   secondAST)
30
31 // We handle all the bare SPDX license and exception ids as well.
32 require('spdx-license-ids').forEach(function(id) {
33   assert.deepEqual(
34     parse(id),
35     { license: id })
36   require('spdx-exceptions').forEach(function(e) {
37     assert.deepEqual(
38       parse(id + ' WITH ' + e),
39       { license: id, exception: e }) }) })
40 ```
41
42 ---
43
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.