Skip to content

Commit 19a9fd0

Browse files
committed
npx standard --fix
1 parent 7f38f35 commit 19a9fd0

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

parse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = function (tokens) {
6060
if (t.type === 'LICENSEREF') {
6161
next()
6262
string += 'LicenseRef-' + t.string
63-
return {license: string}
63+
return { license: string }
6464
}
6565
index = begin
6666
}
@@ -69,7 +69,7 @@ module.exports = function (tokens) {
6969
var t = token()
7070
if (t && t.type === 'LICENSE') {
7171
next()
72-
var node = {license: t.string}
72+
var node = { license: t.string }
7373
if (parseOperator('+')) {
7474
node.plus = true
7575
}

scan.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ module.exports = function (source) {
7070
function documentRef () {
7171
if (read('DocumentRef-')) {
7272
var string = expectIdstring()
73-
return {type: 'DOCUMENTREF', string: string}
73+
return { type: 'DOCUMENTREF', string: string }
7474
}
7575
}
7676

7777
function licenseRef () {
7878
if (read('LicenseRef-')) {
7979
var string = expectIdstring()
80-
return {type: 'LICENSEREF', string: string}
80+
return { type: 'LICENSEREF', string: string }
8181
}
8282
}
8383

test/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ it('forbids tabs and newlines', function () {
1414
it('allows many spaces', function () {
1515
assert.deepEqual(
1616
p(' MIT'),
17-
{license: 'MIT'}
17+
{ license: 'MIT' }
1818
)
1919

2020
assert.deepEqual(
2121
p('MIT '),
22-
{license: 'MIT'}
22+
{ license: 'MIT' }
2323
)
2424

2525
assert.deepEqual(
2626
p('MIT AND BSD-3-Clause'),
2727
{
28-
left: {license: 'MIT'},
28+
left: { license: 'MIT' },
2929
conjunction: 'and',
30-
right: {license: 'BSD-3-Clause'}
30+
right: { license: 'BSD-3-Clause' }
3131
}
3232
)
3333
})
@@ -42,12 +42,12 @@ it('forbids spaces between a license-id and a following `+`', function () {
4242
it('parses DocumentRefs and LicenseRefs', function () {
4343
assert.deepEqual(
4444
p('LicenseRef-something'),
45-
{license: 'LicenseRef-something'}
45+
{ license: 'LicenseRef-something' }
4646
)
4747

4848
assert.deepEqual(
4949
p('DocumentRef-spdx-tool-1.2 : LicenseRef-MIT-Style-2'),
50-
{license: 'DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2'}
50+
{ license: 'DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2' }
5151
)
5252
})
5353

@@ -56,12 +56,12 @@ it('parses `AND`, `OR` and `WITH` with the correct precedence', function () {
5656
assert.deepEqual(
5757
p('MIT AND BSD-3-Clause AND CC-BY-4.0'),
5858
{
59-
left: {license: 'MIT'},
59+
left: { license: 'MIT' },
6060
conjunction: 'and',
6161
right: {
62-
left: {license: 'BSD-3-Clause'},
62+
left: { license: 'BSD-3-Clause' },
6363
conjunction: 'and',
64-
right: {license: 'CC-BY-4.0'}
64+
right: { license: 'CC-BY-4.0' }
6565
}
6666
}
6767
)
@@ -70,15 +70,15 @@ it('parses `AND`, `OR` and `WITH` with the correct precedence', function () {
7070
p('MIT AND BSD-3-Clause WITH GCC-exception-3.1 OR CC-BY-4.0 AND Apache-2.0'),
7171
{
7272
left: {
73-
left: {license: 'MIT'},
73+
left: { license: 'MIT' },
7474
conjunction: 'and',
75-
right: {license: 'BSD-3-Clause', exception: 'GCC-exception-3.1'}
75+
right: { license: 'BSD-3-Clause', exception: 'GCC-exception-3.1' }
7676
},
7777
conjunction: 'or',
7878
right: {
79-
left: {license: 'CC-BY-4.0'},
79+
left: { license: 'CC-BY-4.0' },
8080
conjunction: 'and',
81-
right: {license: 'Apache-2.0'}
81+
right: { license: 'Apache-2.0' }
8282
}
8383
}
8484
)

0 commit comments

Comments
 (0)