Function route

    • Parse a :name pattern against a kind schema, owning fresh slot cells. Returns the rendered URL text and the typed params cells; edit either side and the other stays in sync.

       const { text, params } = route("/users/:id/posts/:slug",
         { id: "int", slug: "str" });
      

      Type Parameters

      • S extends Record<string, ParamKind>

      Parameters

      • pattern: string
      • schema: S

      Returns {
          params: { [K in string | number | symbol]: ParamCell<S[K]> };
          text: Writable<Str>;
      }