Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop old nodes #365

Merged
merged 4 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,13 @@ jobs:
strategy:
matrix:
node-version:
- 14
- 16
- 18
- 20
- 21
- 22
os:
- ubuntu-latest
- windows-latest
- macOS-latest
exclude:
- os: windows-latest
node-version: 14
- os: macos-latest
node-version: 14
- os: macos-latest
node-version: 16
- os: windows-latest
node-version: 22

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ jspm_packages
*.swp

package-lock.json

.tap
3 changes: 0 additions & 3 deletions .taprc

This file was deleted.

3 changes: 2 additions & 1 deletion lib/strategies/http-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
set: (type, store) => { handlers[type] = store }
}
},
deriveConstraint: /* istanbul ignore next */ (req) => req.method,
/* c8 ignore next 1 */
deriveConstraint: (req) => req.method,
mustMatchWhenDerived: true
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"bench:cmp:ci": "node ./benchmark/compare-branches.js --ci",
"test:lint": "standard",
"test:typescript": "tsd",
"test": "standard && tap -J test/*.test.js && npm run test:typescript",
"test": "standard && tap --allow-incomplete-coverage test/*.test.js && npm run test:typescript",
"test:report": "tap -J test/*.test.js --cov --coverage-report=html --coverage-report=cobertura | tee out.tap",
"test:reporter": "tap-mocha-reporter xunit < out.tap > test/junit-testresults.xml"
},
Expand All @@ -35,23 +35,23 @@
},
"homepage": "https://github.com/delvedor/find-my-way#readme",
"devDependencies": {
"@types/node": "^14.0.27",
"@types/node": "^20.0.0",
"benchmark": "^2.1.4",
"chalk": "^4.1.2",
"inquirer": "^8.2.4",
"pre-commit": "^1.2.2",
"proxyquire": "^2.1.3",
"rfdc": "^1.3.0",
"simple-git": "^3.7.1",
"standard": "^14.3.4",
"tap": "^16.0.1",
"standard": "^17.0.0",
"tap": "^21.0.1",
"tap-mocha-reporter": "^5.0.1",
"tsd": "^0.13.1"
"tsd": "^0.31.0"
},
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-querystring": "^1.0.0",
"safe-regex2": "^3.1.0"
"safe-regex2": "^4.0.0"
},
"tsd": {
"directory": "test/types"
Expand Down
14 changes: 7 additions & 7 deletions test/find-route.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test('findRoute returns handler and store for a static route', (t) => {
const route = findMyWay.findRoute('GET', '/example')
t.equal(route.handler, handler)
t.equal(route.store, store)
t.deepEqual(route.params, [])
t.same(route.params, [])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand Down Expand Up @@ -80,7 +80,7 @@ test('findRoute returns handler and params for a parametric route', (t) => {

const route = findMyWay.findRoute('GET', '/:param')
t.equal(route.handler, handler)
t.deepEqual(route.params, ['param'])
t.same(route.params, ['param'])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand Down Expand Up @@ -113,7 +113,7 @@ test('findRoute returns handler and params for a parametric route with static su

const route = findMyWay.findRoute('GET', '/:param-static')
t.equal(route.handler, handler)
t.deepEqual(route.params, ['param'])
t.same(route.params, ['param'])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand Down Expand Up @@ -144,7 +144,7 @@ test('findRoute returns handler and original params even if a param name differe

const route = findMyWay.findRoute('GET', '/:param2')
t.equal(route.handler, handler)
t.deepEqual(route.params, ['param1'])
t.same(route.params, ['param1'])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand All @@ -161,7 +161,7 @@ test('findRoute returns handler and params for a multi-parametric route', (t) =>

const route = findMyWay.findRoute('GET', '/:param1-:param2')
t.equal(route.handler, handler)
t.deepEqual(route.params, ['param1', 'param2'])
t.same(route.params, ['param1', 'param2'])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand Down Expand Up @@ -192,7 +192,7 @@ test('findRoute returns handler and regexp param for a regexp route', (t) => {

const route = findMyWay.findRoute('GET', '/:param(^\\d+$)')
t.equal(route.handler, handler)
t.deepEqual(route.params, ['param'])
t.same(route.params, ['param'])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand Down Expand Up @@ -223,7 +223,7 @@ test('findRoute returns handler and wildcard param for a wildcard route', (t) =>

const route = findMyWay.findRoute('GET', '/example/*')
t.equal(route.handler, handler)
t.deepEqual(route.params, ['*'])
t.same(route.params, ['*'])

equalRouters(t, findMyWay, fundMyWayClone)
})
Expand Down
10 changes: 5 additions & 5 deletions test/issue-330.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ test('Cannot derive constraints without active strategies.', (t) => {
const constrainer = new Constrainer()
const before = constrainer.deriveSyncConstraints
constrainer._buildDeriveConstraints()
t.sameStrict(constrainer.deriveSyncConstraints, before)
t.same(constrainer.deriveSyncConstraints, before)
})

test('getMatchingHandler should return null if not compiled', (t) => {
Expand Down Expand Up @@ -195,13 +195,13 @@ test('SemVerStore.maxPatches should increase automatically', (t) => {
const storage = new Storage()

storage.set('2.0.0')
t.sameStrict(storage.maxPatches, { '2.0': 0 })
t.same(storage.maxPatches, { '2.0': 0 })

storage.set('2.0.2')
t.sameStrict(storage.maxPatches, { '2.0': 2 })
t.same(storage.maxPatches, { '2.0': 2 })

storage.set('2.0.1')
t.sameStrict(storage.maxPatches, { '2.0': 2 })
t.same(storage.maxPatches, { '2.0': 2 })
})

test('Major version must be a numeric value', t => {
Expand All @@ -228,5 +228,5 @@ test('if buildPrettyMeta argument is undefined, will return an object', (t) => {
t.plan(1)

const findMyWay = FindMyWay()
t.sameStrict(findMyWay.buildPrettyMeta(), {})
t.same(findMyWay.buildPrettyMeta(), {})
})
2 changes: 1 addition & 1 deletion test/null-object.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test('NullObject', t => {

test('has no methods from generic Object class', t => {
function getAllPropertyNames (obj) {
var props = []
const props = []

do {
Object.getOwnPropertyNames(obj).forEach(function (prop) {
Expand Down
2 changes: 1 addition & 1 deletion test/types/router.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectType } from 'tsd'
import * as Router from '../../'
import Router from '../../'
import { Http2ServerRequest, Http2ServerResponse } from 'http2'
import { IncomingMessage, ServerResponse } from 'http'

Expand Down