ProperJS // MatchRoute
Wildcard route matching for urls with !num and !slug conditions.
Installation
npm install properjs-matchroute --save-dev
Usage
Alone this utility may not be that useful, which is why it's used with the ProperJS/Router.
; const routes = // Known route "some/route" // Unknown route "another/:slug" // Enforce Number on last URI segment "also/:slug/:num!num"; const matcher = routes ; // Test url against routesconsole; // Compare a route against a urlconsole; // Parse a url against routes configconsole; // Get params property from .parse()console; // Set routes config after initialization// Wildcard any route that is non-external to your domainmatcher;