0.3.0 • Published 8 years ago
pathlizer v0.3.0
pathlizer
Extract a structured object from a string representing a path.
Example
const Path = require('pathlizer')
new Path('/foo/bar/:param(^\\d{4})/baz/*')
{
value: '/foo/bar/:param/baz/*',
trunks: [{
value: '/foo/bar/',
type: 0
}, {
value: 'param',
regexp: /^\d{4}/,
escape: '/',
type: 10
}, {
value: '/baz/',
type: 0
}, {
value: '*',
type: 99
}]
}