nl_tokens: findRoute takes a verb and a url and returns a matching GhostTrain . Route or null if no matches . url can be a string that gets parsed or an already parsed ( . / lib / url#parse ) URL object .
pl_tokens: function findRoute ( ghosttrain , verb , <mask> ) { // Extract path from the object or string var path = url . pathname ? url . pathname : parseURL ( url ) ; var routes = ghosttrain . routes [ verb . toLowerCase ( ) ] ; if ( ! routes ) return null ; for ( var i = 0 ; i < routes . length ; i ++ ) if ( routes [ i ] . match ( path ) ) return routes [ i ] ; return null ; }