From 2928c68a7bf09d820c2ebe34f7cdf2bb854401d9 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 10 Apr 2020 12:20:22 +0200 Subject: [PATCH] Updated dependencies --- .taprc | 4 ++++ azure-pipelines.yml | 10 ++++------ index.js | 7 +++++-- package.json | 6 +++--- test/errors.test.js | 20 ++++++++++---------- test/version.custom-versioning.test.js | 2 +- 6 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 .taprc diff --git a/.taprc b/.taprc new file mode 100644 index 00000000..43f9ae24 --- /dev/null +++ b/.taprc @@ -0,0 +1,4 @@ +esm: false +ts: false +jsx: false +flow: false diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8822ffcc..7e0aff08 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 diff --git a/index.js b/index.js index e4387cc0..d3865033 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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() diff --git a/package.json b/package.json index d6ffa69e..9254d643 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/errors.test.js b/test/errors.test.js index fb355368..7b794f1f 100644 --- a/test/errors.test.js +++ b/test/errors.test.js @@ -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\'') } }) @@ -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/\'') } }) @@ -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/\'') } }) }) @@ -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\'') } }) @@ -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/\'') } }) @@ -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/\'') } }) }) diff --git a/test/version.custom-versioning.test.js b/test/version.custom-versioning.test.js index 2f709475..d4b18e28 100644 --- a/test/version.custom-versioning.test.js +++ b/test/version.custom-versioning.test.js @@ -17,7 +17,7 @@ const customVersioning = { } }, deriveVersion: (req, ctx) => { - return req.headers['accept'] + return req.headers.accept } }