···178178 // call navigate hooks if available
179179 if (hooks.length) {
180180 const hookArgs = this.#makeHookArgs();
181181- const results = await Promise.all(
181181+ await Promise.all(
182182 hooks.map((hook) =>
183183 // wrap in async IIFE to catch all sync/async errors
184184 (async () => hook(hookArgs))(),
···333333334334 let index = 0;
335335 let found = true; // true first to add root node data
336336- while (1) {
336336+ while (true) {
337337 // root route is always matched, so need to add its data
338338 // first, and continue the lookup.
339339 if (found) {
···411411 dynNode.data.parseParams ? dynNode.data.parseParams(filtered) : filtered,
412412 );
413413 } catch (e) {
414414+ this.#capturedError = e;
414415 // `parseParams` function can throw error to not match the params
415416 return null;
416417 }
···425426 // components are simply functions
426427 // @ts-expect-error __ruta is added in node insertion to Trie
427428 if (comp && comp.__ruta && typeof comp === 'function') {
428428- const promise = comp()
429429+ // Without typecasting here, typechecking in
430430+ // ruta-vue, ruta-svelte fails.
431431+ const promise = (comp as RouteComponentLazy)()
429432 .then((c) => {
430433 // replace with the resolved component
431434 return (route.comps[i] = c.default);
+3
packages/ruta-core/mod.ts
···11+/// <reference types="@types/dom-navigation" />
22+/// <reference types="urlpattern-polyfill" />
33+14export { Ruta, createRouteBuilder, createEmptyRoute, warn } from './internal.ts';
25export type { RutaOptions, Route, Register } from './internal.ts';