Skip to content

Commit e460b42

Browse files
committed
Fix new linting errors
1 parent 44f7563 commit e460b42

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function unescape (token) {
3232
return token.replace(/~1/g, '/').replace(/~0/g, '~');
3333
}
3434

35-
const validPointer = /^([#\/]?$|#?\/.*)/;
35+
const validPointer = /^([#/]?$|#?\/.*)/;
3636

3737
function validatePointer (pointer) {
3838
if (!validPointer.test(pointer)) {

test/dereferencing-tests.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ describe('get()', function () {
6060
describe('rfc6901 compliance', function () {
6161
// See https://tools.ietf.org/html/rfc6901#section-5
6262

63+
// eslint no-useless-escape rule disabled for some lines
64+
// as theses checks are taken straight from the spec so
65+
// don't want to change them.
66+
6367
const testDoc = {
6468
foo: ['bar', 'baz'],
6569
'': 0,
@@ -68,7 +72,7 @@ describe('get()', function () {
6872
'e^f': 3,
6973
'g|h': 4,
7074
'i\\j': 5,
71-
'k\"l': 6,
75+
'k\"l': 6, // eslint-disable-line no-useless-escape
7276
' ': 7,
7377
'm~n': 8
7478
};
@@ -83,7 +87,7 @@ describe('get()', function () {
8387
{ pointer: '/e^f', expected: 3 },
8488
{ pointer: '/g|h', expected: 4 },
8589
{ pointer: '/i\\j', expected: 5 },
86-
{ pointer: '/k\"l', expected: 6 },
90+
{ pointer: '/k\"l', expected: 6 }, // eslint-disable-line no-useless-escape
8791
{ pointer: '/ ', expected: 7 },
8892
{ pointer: '/m~0n', expected: 8 },
8993
{ pointer: '#', expected: testDoc },

0 commit comments

Comments
 (0)