Buckets:
| const { test } = require('node:test') | |
| const FindMyWay = require('../') | |
| const noop = function () {} | |
| test('issue-62', (t) => { | |
| t.plan(2) | |
| const findMyWay = FindMyWay({ allowUnsafeRegex: true }) | |
| findMyWay.on('GET', '/foo/:id(([a-f0-9]{3},?)+)', noop) | |
| t.assert.ok(!findMyWay.find('GET', '/foo/qwerty')) | |
| t.assert.ok(findMyWay.find('GET', '/foo/bac,1ea')) | |
| }) | |
| test('issue-62 - escape chars', (t) => { | |
| const findMyWay = FindMyWay() | |
| t.plan(2) | |
| findMyWay.get('/foo/:param(\\([a-f0-9]{3}\\))', noop) | |
| t.assert.ok(!findMyWay.find('GET', '/foo/abc')) | |
| t.assert.ok(findMyWay.find('GET', '/foo/(abc)', {})) | |
| }) | |
Xet Storage Details
- Size:
- 634 Bytes
- Xet hash:
- 9a13a8ae556f046e76596f11b1495ea96dfe5bc09d12c3bb19dc660cd5d7060a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.