Skip to content
Myr

tool.mts

This file

Path

benchmarks/routers/src/tool.mts

26 lines · 804 bytes · TypeScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 83bfb3b point at it.

4.12.23Yusuke Wadabefore adoption83bfb3b

lines 1–26why, one step back
1export const handler = () => {}
23export type Route = {4 method: 'GET' | 'POST'5 path: string6}78export interface RouterInterface {9 name: string10 match: (route: Route) => unknown11}1213export const routes: Route[] = [14 { method: 'GET', path: '/user' },15 { method: 'GET', path: '/user/comments' },16 { method: 'GET', path: '/user/avatar' },17 { method: 'GET', path: '/user/lookup/username/:username' },18 { method: 'GET', path: '/user/lookup/email/:address' },19 { method: 'GET', path: '/event/:id' },20 { method: 'GET', path: '/event/:id/comments' },21 { method: 'POST', path: '/event/:id/comment' },22 { method: 'GET', path: '/map/:location/events' },23 { method: 'GET', path: '/status' },24 { method: 'GET', path: '/very/deeply/nested/route/hello/there' },25 { method: 'GET', path: '/static/*' },26]