js-green-licenses
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -160,5 +160,9 @@ "use strict"; | ||
} | ||
if (typeof license === 'string') | ||
if (typeof license === 'string') { | ||
return license; | ||
} | ||
if (Array.isArray(license)) { | ||
if (license.length === 0) { | ||
return null; | ||
} | ||
const types = license.map(x => x.type).filter(x => !!x); | ||
@@ -165,0 +169,0 @@ return types.length === 1 ? types[0] : `(${types.join(' OR ')})`; |
@@ -7,2 +7,9 @@ # Changelog | ||
### [3.0.1](https://www.github.com/google/js-green-licenses/compare/v3.0.0...v3.0.1) (2021-04-05) | ||
### Bug Fixes | ||
* handle incorrect licenses fields ([#146](https://www.github.com/google/js-green-licenses/issues/146)) ([209847f](https://www.github.com/google/js-green-licenses/commit/209847fa96d3f8676cfb292ef879a7e58e4cdecd)) | ||
## [3.0.0](https://www.github.com/google/js-green-licenses/compare/v2.0.1...v3.0.0) (2021-01-22) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "js-green-licenses", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "JavaScript package.json license checker", | ||
@@ -5,0 +5,0 @@ "main": "build/src/checker.js", |
@@ -114,11 +114,11 @@ # JavaScript package.json License Checker | ||
const DEFAULT_GREEN_LICENSES = [ | ||
'AFL-2.1', 'AFL-3.0', 'APSL-2.0', 'Apache-1.1', 'Apache-2.0', | ||
'Artistic-1.0', 'Artistic-2.0', 'BSD-2-Clause', 'BSD-3-Clause', 'BSL-1.0', | ||
'CC-BY-1.0', 'CC-BY-2.0', 'CC-BY-2.5', 'CC-BY-3.0', 'CC-BY-4.0', | ||
'CC0-1.0', 'CDDL-1.0', 'CDDL-1.1', 'CPL-1.0', 'EPL-1.0', | ||
'FTL', 'IPL-1.0', 'ISC', 'LGPL-2.0', 'LGPL-2.1', | ||
'LGPL-3.0', 'LPL-1.02', 'MIT', 'MPL-1.0', 'MPL-1.1', | ||
'MPL-2.0', 'MS-PL', 'NCSA', 'OpenSSL', 'PHP-3.0', | ||
'Ruby', 'Unlicense', 'W3C', 'Xnet', 'ZPL-2.0', | ||
'Zend-2.0', 'Zlib', 'libtiff', | ||
'0BSD', 'AFL-2.1', 'AFL-3.0', 'APSL-2.0', 'Apache-1.1', | ||
'Apache-2.0', 'Artistic-1.0', 'Artistic-2.0', 'BSD-2-Clause', 'BSD-3-Clause', | ||
'BSL-1.0', 'CC-BY-1.0', 'CC-BY-2.0', 'CC-BY-2.5', 'CC-BY-3.0', | ||
'CC-BY-4.0', 'CC0-1.0', 'CDDL-1.0', 'CDDL-1.1', 'CPL-1.0', | ||
'EPL-1.0', 'FTL', 'IPL-1.0', 'ISC', 'LGPL-2.0', | ||
'LGPL-2.1', 'LGPL-3.0', 'LPL-1.02', 'MIT', 'MPL-1.0', | ||
'MPL-1.1', 'MPL-2.0', 'MS-PL', 'NCSA', 'OpenSSL', | ||
'PHP-3.0', 'Ruby', 'Unlicense', 'W3C', 'Xnet', | ||
'ZPL-2.0', 'Zend-2.0', 'Zlib', 'libtiff', | ||
]; | ||
@@ -125,0 +125,0 @@ ``` |
Sorry, the diff of this file is not supported yet
88182
935