export const requirePathMatch = (pattern, ...handlers) => { return async (c, next) => { const match = c.req.path.match(pattern); if (!match) { return next(); } c.set('pathMatch', match); let index = -1; const dispatch = async (i) => { if (i <= index) { throw new Error('next() called multiple times'); } index = i; const handler = handlers[i]; if (!handler) { return next(); } return handler(c, (async () => { return dispatch(i + 1); })); }; return dispatch(0); }; }; //# sourceMappingURL=requirePathMatch.js.map