Skip to content

Commit 8d986c1

Browse files
authored
Merge pull request #7 from BackendStack21/updating-deps
supporting find-my-way v5.x
2 parents 78530a9 + 5547983 commit 8d986c1

File tree

8 files changed

+106
-9
lines changed

8 files changed

+106
-9
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
custom: https://www.paypal.me/kyberneees
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Have you contributed with at least a little donation to support the development of this project?**
11+
- Paypal: https://www.paypal.me/kyberneees
12+
- [TRON](https://www.binance.com/en/buy-TRON) Wallet: `TJ5Bbf9v4kpptnRsePXYDvnYcYrS5Tyxus`
13+
14+
**Is your feature request related to a problem? Please describe.**
15+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
16+
17+
**Describe the solution you'd like**
18+
A clear and concise description of what you want to happen.
19+
20+
**Describe alternatives you've considered**
21+
A clear and concise description of any alternative solutions or features you've considered.
22+
23+
**Additional context**
24+
Add any other context or screenshots about the feature request here.

.github/workflows/tests.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
testing:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v1
9+
- name: Setup Environment (Using NodeJS 16.x)
10+
uses: actions/setup-node@v1
11+
with:
12+
node-version: 16.x
13+
14+
- name: Install dependencies
15+
run: npm install
16+
17+
- name: Linting
18+
run: npx standard
19+
20+
- name: Run tests
21+
run: npm run test

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# middleware-if-unless
22
Invokes connect-like middleware if / unless routing criteria matches. Inspired on [express-unless](https://www.npmjs.com/package/express-unless) module.
3+
>
34
45
## Main features
56
- Advanced routes matching capabilities. Uses [find-my-way](https://www.npmjs.com/package/find-my-way) or any compatible router to match the routes.
6-
- `iff`: execute middleware only if the routes matches. Ideal use case: API gateways (see: [k-fastify-gateway](https://www.npmjs.com/package/k-fastify-gateway))
7+
- `iff`: execute middleware only if the routes matches. Ideal use case: API gateways (see: [fast-gateway](https://www.npmjs.com/package/fast-gateway))
78
- `unless`: execute middleware always unless the routes matches.
89
- Arbitraty chaining of iff -> unless of vice-versa.
910
- Low overhead, crazy fast implementation.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function (routerOpts = {}, routerFactory = require('find-my-way
2525
.map(endpoint => typeof endpoint === 'string' ? { url: endpoint } : endpoint)
2626
.forEach(({ methods = ['GET'], url, version, updateParams = false }) => {
2727
if (version) {
28-
router.on(methods, url, { version }, handlers.match(updateParams))
28+
router.on(methods, url, { constraints: { version } }, handlers.match(updateParams))
2929
} else {
3030
router.on(methods, url, handlers.match(updateParams))
3131
}

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
},
2929
"homepage": "https://github.com/jkyberneees/middleware-if-unless#readme",
3030
"devDependencies": {
31-
"chai": "^4.2.0",
32-
"express-unless": "^0.5.0",
33-
"mocha": "^8.2.1",
34-
"nyc": "^14.1.1",
35-
"restana": "^4.8.0",
36-
"supertest": "^6.0.1"
31+
"chai": "^4.3.6",
32+
"express-unless": "^1.0.0",
33+
"mocha": "^9.2.2",
34+
"nyc": "^15.1.0",
35+
"restana": "^4.9.4",
36+
"supertest": "^6.2.2"
3737
},
3838
"dependencies": {
39-
"find-my-way": "^3.0.5"
39+
"find-my-way": "^5.5.1"
4040
}
4141
}

0 commit comments

Comments
 (0)