next/server/middleware/20.cidx.ts

5 lines
158 B
TypeScript
Raw Normal View History

export default eventHandler((ev) => {
let chapParam = getRouterParams(ev).chapter;
ev.context.chapterIndex = !!chapParam ? parseInt(chapParam) - 1 : 0;
});