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>pick

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

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

static > dynamic > splat > root

This way we don't have to worry about the order of our routes, let the computers do it.

A route looks like this

{ path, default, value }

And a returned match looks like:

{ route, params, uri }

Parameters

routes
uri