Skip to content
Ankit Patel edited this page Aug 5, 2017 · 9 revisions

wip...

ultra-router

check(...identifiers)(...checks)

Create a validation object to check one or more identifiers with one or more regular expressions (literal/object form).

check(':year')(/^201[0-7]$/) // 2010 - 2017
check(':vehicle', ':color')(/.{3}/, /^[a-z]+$/) // at least 3 characters

spec(...pathKeys)(next, err?, fail?)

Create a spec over one or more path keys and actions.

// show "vehicle" by "year" or "color"
spec('/:vehicle', '/:vehicle/:year', '/:vehicle/:color')(next, err, fail)

/**************
next: on exact match
  /automobile or /motorcycle
  /automobile/red or /automobile/2017
  /motorcycle/blue or /motorcycle/2017

err: on partial match
  /automobile/2020 or /motorcycle/z

fail: no match
  /z
**************/

match

prefixMatch

miss

toggle

toggleSelected

utils

assignValues

ultra

Clone this wiki locally