Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -1,28 +1,28 @@
'use strict'
const t = require('tap')
const { test } = require('node:test')
const FindMyWay = require('../')
const noop = function () {}
t.test('issue-62', (t) => {
test('issue-62', (t) => {
t.plan(2)
const findMyWay = FindMyWay({ allowUnsafeRegex: true })
findMyWay.on('GET', '/foo/:id(([a-f0-9]{3},?)+)', noop)
t.notOk(findMyWay.find('GET', '/foo/qwerty'))
t.ok(findMyWay.find('GET', '/foo/bac,1ea'))
t.assert.ok(!findMyWay.find('GET', '/foo/qwerty'))
t.assert.ok(findMyWay.find('GET', '/foo/bac,1ea'))
})
t.test('issue-62 - escape chars', (t) => {
test('issue-62 - escape chars', (t) => {
const findMyWay = FindMyWay()
t.plan(2)
findMyWay.get('/foo/:param(\\([a-f0-9]{3}\\))', noop)
t.notOk(findMyWay.find('GET', '/foo/abc'))
t.ok(findMyWay.find('GET', '/foo/(abc)', {}))
t.assert.ok(!findMyWay.find('GET', '/foo/abc'))
t.assert.ok(findMyWay.find('GET', '/foo/(abc)', {}))
})