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 3
3
var scan = require ( './scan' )
4
4
var parse = require ( './parse' )
5
5
6
- module . exports = function ( source ) {
7
- return parse ( scan ( source ) )
6
+ module . exports = function ( source , validateLicenseNames = true ) {
7
+ return parse ( scan ( source , validateLicenseNames ) )
8
8
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var licenses = []
5
5
. concat ( require ( 'spdx-license-ids/deprecated' ) )
6
6
var exceptions = require ( 'spdx-exceptions' )
7
7
8
- module . exports = function ( source ) {
8
+ module . exports = function ( source , validateLicenseNames = true ) {
9
9
var index = 0
10
10
11
11
function hasMore ( ) {
@@ -85,14 +85,14 @@ module.exports = function (source) {
85
85
var begin = index
86
86
var string = idstring ( )
87
87
88
- if ( licenses . indexOf ( string ) !== - 1 ) {
88
+ if ( exceptions . indexOf ( string ) !== - 1 ) {
89
89
return {
90
- type : 'LICENSE ' ,
90
+ type : 'EXCEPTION ' ,
91
91
string : string
92
92
}
93
- } else if ( exceptions . indexOf ( string ) !== - 1 ) {
93
+ } else if ( licenses . indexOf ( string ) !== - 1 || ! validateLicenseNames ) {
94
94
return {
95
- type : 'EXCEPTION ' ,
95
+ type : 'LICENSE ' ,
96
96
string : string
97
97
}
98
98
}
You can’t perform that action at this time.
0 commit comments