export const requireQuery = (key, ...handlers) => { return async (c, next) => { const value = c.req.query(key); if (typeof value === 'undefined') { return next(); } 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=requireQuery.js.map