Skip to main content
Glama
issue-62.test.js634 B
'use strict' 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)', {})) })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/krtw00/search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server