File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,11 @@ assert.deepEqual(
32
32
require (' spdx-license-ids' ).forEach (function (id ) {
33
33
assert .deepEqual (
34
34
parse (id),
35
- { license: id });
35
+ { license: id })
36
36
require (' spdx-exceptions' ).forEach (function (e ) {
37
37
assert .deepEqual (
38
38
parse (id + ' WITH ' + e),
39
- { license: id, exception: e });
40
- });
41
- });
39
+ { license: id, exception: e }) }) })
42
40
```
43
41
44
42
---
Original file line number Diff line number Diff line change @@ -10,21 +10,18 @@ var quote = function(argument) {
10
10
return '\'' + argument + '\'' }
11
11
12
12
var regexEscape = function ( s ) {
13
- return s . replace ( / [ \^ \\ $ * + ? . ( ) | { } \[ \] \/ ] / g, '\\$&' ) ;
14
- } ;
13
+ return s . replace ( / [ \^ \\ $ * + ? . ( ) | { } \[ \] \/ ] / g, '\\$&' ) }
15
14
16
15
var handleLicensesAndExceptions = function ( ) {
17
- var ids = require ( 'spdx-license-ids' ) ;
18
- var exceptions = require ( 'spdx-exceptions' ) ;
16
+ var ids = require ( 'spdx-license-ids' )
17
+ var exceptions = require ( 'spdx-exceptions' )
19
18
20
19
// Sort tokens longest-first (both license ids and exception strings)
21
- var tokens = ids . concat ( exceptions ) ;
22
- tokens . sort ( function ( a , b ) { return b . length - a . length ; } ) ;
20
+ var tokens = ids . concat ( exceptions )
21
+ tokens . sort ( function ( a , b ) { return ( b . length - a . length ) } )
23
22
return tokens . map ( function ( t ) {
24
- var type = ( ids . indexOf ( t ) >= 0 ) ? 'LICENSE' : 'EXCEPTION' ;
25
- return [ regexEscape ( t ) , 'return ' + quote ( type ) ] ;
26
- } ) ;
27
- }
23
+ var type = ( ( ids . indexOf ( t ) >= 0 ) ? 'LICENSE' : 'EXCEPTION' )
24
+ return [ regexEscape ( t ) , ( 'return ' + quote ( type ) ) ] } ) }
28
25
29
26
var grammar = {
30
27
lex : {
You can’t perform that action at this time.
0 commit comments