Skip to content

Commit

Permalink
fix(arborist): fix superfluous arguments (npm#4464)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Feb 23, 2022
1 parent dd63e21 commit e930921
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion workspaces/arborist/test/audit-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const sortReport = report => {
{
...vuln,
via: (vuln.via || []).sort((a, b) =>
String(a.source || a).localeCompare(String(b.source || b, 'en'))),
String(a.source || a).localeCompare(String(b.source || b), 'en')),
effects: (vuln.effects || []).sort((a, b) => a.localeCompare(b, 'en')),
},
])
Expand Down
2 changes: 1 addition & 1 deletion workspaces/arborist/test/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const formatDiff = obj =>
removed: obj.removed.map(d => normalizePath(d.path).split(normalizedCWD).join('{CWD}')),
children: [...obj.children]
.map(formatDiff)
.sort((a, b) => path(a).localeCompare(path(b, 'en'))),
.sort((a, b) => path(a).localeCompare(path(b), 'en')),
})

t.formatSnapshot = obj => format(formatDiff(obj), { sort: false })
Expand Down
4 changes: 2 additions & 2 deletions workspaces/arborist/test/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ t.test('basic operations', t => {
i.get('y'),
], 'filter returns an iterable of all matching nodes')

t.same([...i.query('license')].sort((a, b) => String(a).localeCompare(String(b, 'en'))),
t.same([...i.query('license')].sort((a, b) => String(a).localeCompare(String(b), 'en')),
['ISC', 'MIT', undefined])
t.same([...i.query('license', 'MIT')], [
{ location: 'x', name: 'x', package: { licence: 'MIT', funding: 'foo' } },
Expand All @@ -33,7 +33,7 @@ t.test('basic operations', t => {
{ location: 'x', name: 'x', package: { licence: 'MIT', funding: 'foo' } },
{ location: 'y', name: 'x', package: { licenses: [{ type: 'ISC' }], funding: { url: 'foo' } } },
], 'can query by name')
t.same([...i.query('funding')].sort((a, b) => String(a).localeCompare(String(b, 'en'))),
t.same([...i.query('funding')].sort((a, b) => String(a).localeCompare(String(b), 'en')),
['bar', 'foo', undefined])
t.same([...i.query('funding', 'foo')], [
{ location: 'x', name: 'x', package: { licence: 'MIT', funding: 'foo' } },
Expand Down

0 comments on commit e930921

Please sign in to comment.