Skip to content

Commit 8001c89

Browse files
committed
Merge pull request #4 from kemitchell/conform-code-style
Conform code style
2 parents dc918fb + d106445 commit 8001c89

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ assert.deepEqual(
3232
require('spdx-license-ids').forEach(function(id) {
3333
assert.deepEqual(
3434
parse(id),
35-
{ license: id });
35+
{ license: id })
3636
require('spdx-exceptions').forEach(function(e) {
3737
assert.deepEqual(
3838
parse(id + ' WITH ' + e),
39-
{ license: id, exception: e });
40-
});
41-
});
39+
{ license: id, exception: e }) }) })
4240
```
4341

4442
---

generate-parser.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@ var quote = function(argument) {
1010
return '\'' + argument + '\'' }
1111

1212
var regexEscape = function(s) {
13-
return s.replace(/[\^\\$*+?.()|{}\[\]\/]/g, '\\$&');
14-
};
13+
return s.replace(/[\^\\$*+?.()|{}\[\]\/]/g, '\\$&') }
1514

1615
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')
1918

2019
// 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 ) })
2322
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) ) ] }) }
2825

2926
var grammar = {
3027
lex: {

0 commit comments

Comments
 (0)