0.3.0 • Published 8 years ago

pathlizer v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

pathlizer

npm version Build Status Coverage Status

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
  }]
}
0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago