Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

sort-routes

1.0.0 • Public • Published

sort-routes

var bySpecificity = require('sort-routes');
var routes = [
    '/characters/:id',
    '/characters',
    '/characters/new',
];
 
routes.sort(bySpecificity);
[
    '/characters',
    '/characters/new',
    '/characters/:id',
]

Keywords

none

install

npm i sort-routes

Downloadsweekly downloads

1,501

version

1.0.0

license

MIT

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar