Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
A type-safe pattern builder & route matching library written in TypeScript
Factory function to create a chemin function with different default options.
It returns a function that works exactly like chemin but with a default serialize / stringify options.
Compare two chemin params, this will return true if the two params have the same factory and parameters.
Test if two chemins are equal.
Extract all chemins from a chemin including itself.
Flatten a chemin into an array of chemin params.
Check wether an object is a Chemin or not
Accepts one argument and return true if it's a Chemin, false otherwise.
Match a chemin against a pathname and return the params
Match a chemin against a pathname and return the params if the match is exact, otherwise null.
Match a pathname against a list of chemins and return the first match
Add a base to a set of chemins
The match result for pOptional params
Create a fixed value param
Parse an integer params using parseInt(x, 10)
Repeat a param multiple times
Parse a number params using parseFloat(x)
Wrap a param to make it optional
Optional version of pConstant
This can also be done with pOptional(pConstant("home")) but this has a nicer match result (true instead of { present: true, value: null })
Optional version of pString
This can also be done with pOptional(pString("name")) but this has a nicer match result ("name" or false instead of { present: boolean, value: "name" })
Print a chemin from its params.
Split a pathname and prevent empty parts Accepts a string and returns an array of strings.
Transform a chemin into a string representation.
Chemin match result or null if no match
Chemin param type
Chemin param type with any value
Advanced type of teh createChemin function
Empty object type
Type of the input of the serialize function
Extract the params type of a chemin
Part of a chemin, can be a param or a chemin
Part isEqual function
Part match function
Result of a match
Part serialize function
Part stringify function
Serialize function type
Simplify a type by removing the undefined type
Union of all the params of a list of chemins