Changelog History
-
v1.0.1
December 29, 2015 -
v0.10.2
September 09, 2015 -
v0.10.1
September 09, 2015 -
v0.10.0
August 19, 2015 -
v0.9 Changes
May 18, 2015named segments now also match
-
,_
,and
%
.\\
can now be used to escape characters.๐ง made all special chars and charsets used in parsing configurable.
โ added [bower.json](bower.json) and registered with bower as
url-pattern
. -
v0.8 Changes
single wildcard matches are now saved directly as a string on the
_
property and not as an array with 1 element:> var pattern = new Pattern('/api/*'); > pattern.match('/api/users/5') {_: 'users/5'}
if named segments occur more than once the results are collected in an array.
๐ parsing of named segment names (
:foo
) and named segment values now stops at the next non-alphanumeric character. it is no longer needed to declare separators other than/
explicitely. it was previously necessary to use the second argument tonew UrlPattern
to 0๏ธโฃ override the default separator/
. the second argument is now ignored. mixing of separators is now possible (/
and.
in this example):> var pattern = new UrlPattern('/v:major(.:minor)/*'); > pattern.match('/v1.2/'); {major: '1', minor: '2', _: ''} > pattern.match('/v2/users'); {major: '2', _: 'users'} > pattern.match('/v/'); null
-
v0.7 Changes
instead of
var urlPattern = require('url-pattern'); var pattern = urlPattern.newPattern('/example');
now use
var Pattern = require('url-pattern'); var pattern = new Pattern('/example');