Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/snel/core/router/utils.js

A Cybernetical framework for svelte applications in deno
Latest
import * as snel from "https://deno.land/x/snel@v0.7.1/core/router/utils.js";

Functions

Combines the basepath and the path into one path.

Check if the path matches the uri.

Ranks and picks the best route to match. Each segment gets the highest amount of points, then the type of segment gets an additional amount of points where

Resolve URIs as though every path is a directory, no files. Relative URIs in the browser can feel awkward because not only can you be "in a directory", you can be "at a file", too. For example:

Decides whether a given event should result in a navigation or not.

Check if string starts with search

Strip str of potential start and end /