X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Fvalidate-npm-package-license%2Fnode_modules%2Fspdx-expression-parse%2FREADME.md;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Fvalidate-npm-package-license%2Fnode_modules%2Fspdx-expression-parse%2FREADME.md;h=4b96d3e2a9e97de74e9bb577f81bacf11f5caccb;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/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 b/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 new file mode 100644 index 00000000..4b96d3e2 --- /dev/null +++ b/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 @@ -0,0 +1,44 @@ +```javascript +var parse = require('spdx-expression-parse') +var assert = require('assert') + +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) + +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) + +// 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) { + assert.deepEqual( + parse(id + ' WITH ' + e), + { license: id, exception: e }) }) }) +``` + +--- + +[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.