Skip to content

Commit

Permalink
Updated dependencies (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina authored Apr 13, 2020
1 parent a5d041f commit 7625af2
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .taprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
esm: false
ts: false
jsx: false
flow: false
10 changes: 4 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ pool:

strategy:
matrix:
node_6_x:
node_version: 6.x
node_8_x:
node_version: 8.x
node_10_x:
node_version: 10.x
node_11_x:
node_version: 11.x
node_12_x:
node_version: 12.x
node_13_x:
node_version: 13.x

steps:
- task: NodeTool@0
Expand Down
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,14 @@ Router.prototype._insert = function _insert (method, path, kind, params, handler
// let's split the node and add a new child
if (len < prefixLen) {
node = new Node(
{ prefix: prefix.slice(len),
{
prefix: prefix.slice(len),
children: currentNode.children,
kind: currentNode.kind,
handlers: new Node.Handlers(currentNode.handlers),
regex: currentNode.regex,
versions: currentNode.versions }
versions: currentNode.versions
}
)
if (currentNode.wildcardChild !== null) {
node.wildcardChild = currentNode.wildcardChild
Expand Down Expand Up @@ -582,6 +584,7 @@ Router.prototype.prettyPrint = function () {
}

for (var i in http.METHODS) {
/* eslint no-prototype-builtins: "off" */
if (!http.METHODS.hasOwnProperty(i)) continue
const m = http.METHODS[i]
const methodName = m.toLowerCase()
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"benchmark": "^2.1.4",
"pre-commit": "^1.2.2",
"request": "^2.88.0",
"standard": "^12.0.1",
"tap": "^12.5.3",
"tap-mocha-reporter": "^3.0.9",
"standard": "^14.0.0",
"tap": "^14.0.0",
"tap-mocha-reporter": "^5.0.1",
"typescript": "^3.3.3"
},
"dependencies": {
Expand Down
20 changes: 10 additions & 10 deletions test/errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ test('Method already declared', t => {
findMyWay.on('GET', '/test', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test\'')
}
})

Expand All @@ -198,14 +198,14 @@ test('Method already declared [ignoreTrailingSlash=true]', t => {
findMyWay.on('GET', '/test', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test\'')
}

try {
findMyWay.on('GET', '/test/', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/\'')
}
})

Expand All @@ -219,14 +219,14 @@ test('Method already declared [ignoreTrailingSlash=true]', t => {
findMyWay.on('GET', '/test', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test\'')
}

try {
findMyWay.on('GET', '/test/', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/\'')
}
})
})
Expand All @@ -243,7 +243,7 @@ test('Method already declared nested route', t => {
findMyWay.on('GET', '/test/hello', () => {})
t.fail('method already delcared in nested route')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/hello'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/hello\'')
}
})

Expand All @@ -262,14 +262,14 @@ test('Method already declared nested route [ignoreTrailingSlash=true]', t => {
findMyWay.on('GET', '/test/hello', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/hello'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/hello\'')
}

try {
findMyWay.on('GET', '/test/hello/', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/hello/'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/hello/\'')
}
})

Expand All @@ -285,14 +285,14 @@ test('Method already declared nested route [ignoreTrailingSlash=true]', t => {
findMyWay.on('GET', '/test/hello', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/hello'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/hello\'')
}

try {
findMyWay.on('GET', '/test/hello/', () => {})
t.fail('method already declared')
} catch (e) {
t.is(e.message, `Method 'GET' already declared for route '/test/hello/'`)
t.is(e.message, 'Method \'GET\' already declared for route \'/test/hello/\'')
}
})
})
2 changes: 1 addition & 1 deletion test/version.custom-versioning.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const customVersioning = {
}
},
deriveVersion: (req, ctx) => {
return req.headers['accept']
return req.headers.accept
}
}

Expand Down

0 comments on commit 7625af2

Please sign in to comment.