Skip to content

Commit 8042eb6

Browse files
committed
chore: fixed linting
1 parent 94039ef commit 8042eb6

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

lib/layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Layer.prototype.url = function (params, options) {
119119
}
120120
}
121121

122-
const toPath = compile(url, Object.assign({ encode: encodeURIComponent }, options));
122+
const toPath = compile(url, { encode: encodeURIComponent, ...options });
123123
let replaced;
124124

125125
const tokens = parse(url);

test/lib/layer.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,14 @@ describe('Layer', function () {
303303
url.should.equal('/programming/how-to-node');
304304
});
305305

306-
it('escapes using encodeURIComponent()', function() {
307-
const route = new Layer('/:category/:title', ['get'], [function () {}], {name: 'books'});
308-
const url = route.url({ category: 'programming', title: 'how to node & js/ts' });
306+
it('escapes using encodeURIComponent()', function () {
307+
const route = new Layer('/:category/:title', ['get'], [function () {}], {
308+
name: 'books'
309+
});
310+
const url = route.url({
311+
category: 'programming',
312+
title: 'how to node & js/ts'
313+
});
309314
url.should.equal('/programming/how%20to%20node%20%26%20js%2Fts');
310315
});
311316

test/lib/router.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,11 +1675,11 @@ describe('Router', function () {
16751675
router.url(Symbol('books')).should.be.Error();
16761676
});
16771677

1678-
it('escapes using encodeURIComponent()', function() {
1679-
const url = Router.url(
1680-
'/:category/:title',
1681-
{ category: 'programming', title: 'how to node & js/ts' }
1682-
);
1678+
it('escapes using encodeURIComponent()', function () {
1679+
const url = Router.url('/:category/:title', {
1680+
category: 'programming',
1681+
title: 'how to node & js/ts'
1682+
});
16831683
url.should.equal('/programming/how%20to%20node%20%26%20js%2Fts');
16841684
});
16851685
});

0 commit comments

Comments
 (0)