File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 33var scan = require ( './scan' )
44var parse = require ( './parse' )
55
6- module . exports = function ( source ) {
7- return parse ( scan ( source ) )
6+ module . exports = function ( source , validateLicenseNames = true ) {
7+ return parse ( scan ( source , validateLicenseNames ) )
88}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var licenses = []
55 . concat ( require ( 'spdx-license-ids/deprecated' ) )
66var exceptions = require ( 'spdx-exceptions' )
77
8- module . exports = function ( source ) {
8+ module . exports = function ( source , validateLicenseNames = true ) {
99 var index = 0
1010
1111 function hasMore ( ) {
@@ -85,14 +85,14 @@ module.exports = function (source) {
8585 var begin = index
8686 var string = idstring ( )
8787
88- if ( licenses . indexOf ( string ) !== - 1 ) {
88+ if ( exceptions . indexOf ( string ) !== - 1 ) {
8989 return {
90- type : 'LICENSE ' ,
90+ type : 'EXCEPTION ' ,
9191 string : string
9292 }
93- } else if ( exceptions . indexOf ( string ) !== - 1 ) {
93+ } else if ( licenses . indexOf ( string ) !== - 1 || ! validateLicenseNames ) {
9494 return {
95- type : 'EXCEPTION ' ,
95+ type : 'LICENSE ' ,
9696 string : string
9797 }
9898 }
You can’t perform that action at this time.
0 commit comments