Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
1006 B

{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction getRouteMatcher(routeRegex) {\n const {\n re,\n groups\n } = routeRegex;\n return pathname => {\n const routeMatch = re.exec(pathname);\n\n if (!routeMatch) {\n return false;\n }\n\n const decode = param => {\n try {\n return decodeURIComponent(param);\n } catch (_) {\n const err = new Error('failed to decode param');\n err.code = 'DECODE_FAILED';\n throw err;\n }\n };\n\n const params = {};\n Object.keys(groups).forEach(slugName => {\n const g = groups[slugName];\n const m = routeMatch[g.pos];\n\n if (m !== undefined) {\n params[slugName] = ~m.indexOf('/') ? m.split('/').map(entry => decode(entry)) : g.repeat ? [decode(m)] : decode(m);\n }\n });\n return params;\n };\n}\n\nexports.getRouteMatcher = getRouteMatcher;","map":null,"metadata":{},"sourceType":"script"}