{"_id":"@b08/route-matcher","_rev":"3-32e350370895ee87404e67ecc5c16fcb","name":"@b08/route-matcher","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@b08/route-matcher","access":"public","version":"1.0.0","description":"update this","main":"index.js","typings":"index","scripts":{"test":"npx gulp"},"keywords":[],"author":{"name":"Vladimir Repin"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@gitlab.com/b08/route-matcher.git"},"nyc":{"sourceMap":true,"instrument":true,"all":true,"check-coverage":false,"per-file":false,"exclude":["build/src/**/index.js","build/src/**/*.type.js"],"include":["build/src/**/*.js"],"reporter":["text"]},"devDependencies":{"@types/chai":"^4.2.3","@types/fs-extra":"^8.0.0","@types/gulp":"^4.0.6","@types/gulp-mocha":"0.0.32","@types/mocha":"^5.2.7","@types/node":"^12.7.5","@b08/spawn":"^1.0.0","chai":"^4.2.0","fs-extra":"^8.1.0","git-tag":"^0.2.0","globby":"^10.0.1","gulp":"^4.0.2","gulp-mocha":"^3.0.1","mocha":"^6.2.0","nyc":"^13.1.0","ts-node":"^8.4.1","tslint":"^5.20.0","typescript":"^3.6.3"},"dependencies":{"@b08/array":"^1.0.2","@b08/cache":"^1.0.0","@b08/flat-key":"^1.0.1","@b08/object-map":"^1.0.0"},"gitHead":"0c3344f946f9e4c04cf39a05410d07f49762d629","bugs":{"url":"https://gitlab.com/b08/route-matcher/issues"},"homepage":"https://gitlab.com/b08/route-matcher#readme","_id":"@b08/route-matcher@1.0.0","_nodeVersion":"12.10.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-lh8yGYnD0eA0XjXbJZyj8j2ZEB++2hntHUuwiy6qfa8huG1lscLhcr4uqp4B2c7b5pLy123wyu9J+ZlWdAr6Zg==","shasum":"c2de7cb687364365a0fe2295d0654c922f1aab05","tarball":"https://registry.npmjs.org/@b08/route-matcher/-/route-matcher-1.0.0.tgz","fileCount":182,"unpackedSize":73967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkiwqCRA9TVsSAnZWagAAKNQP/3fiVZ4GvYE3TU7cBVJn\npYBEUCY/zCmD5zRY00kqp+cX+3esgfyHZgZ9pqoNnPzgMkg7ApXvN582R8yV\n/MCMxcGDG0ua1qYX+vO0i2OH+mdt2lM4DxO44Gq0/n6ouqY4QIBlFTlBVTPG\n5JrzPjBxse25I5HB2x80rf2undmeM3PLplEIYr4+HdTJliNGuK5jA3k8jGVK\nh2qk2ZhESmg4/lM54AKg489NN89jOdQ4TWLnL+RYWlYNdALrZddvsjWqeBGC\n/rAEJouPG/4ypD29p1NpA7z9XX2A4n+P7gHUXnM8bpBiuc6xb7EJ3HckuVHs\n1UdlJfbgbIFODuQ/jiiuocmnYeR+LImGVmcnsHDYe52Gtgkmx0GWgOzOwLUv\nxb/W6er1D5LFl8agKVdhlPTHfJYi2EJ1s29FgnZeYhu3eypqWPPZIfXx3oqy\np3EHauZt6kV4O2D0tNpG9VSqbFHm4OlpyseMRqcxktqTon/3cdkF85yEI2HD\nkpNOXUMLggn7QQubFZWn4XlfEpsI3zSPMBsf2SSh1iclxsUl5TrSkt7Geqpp\noVteuFGHfQNHxhYD7M2r8I/AdKBIuYBdOkpw3HRXB6QVqEsnTCkQM8wmn8jq\nCZjPLGQ6HgDnQxsZLaBeTKzJ/zczFk/pJxo6e1iZM+XZTrQh7HAiyFDKWAqz\ngyMV\r\n=uNjf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBU7lSmll+EPmL+F7xweMxP3MYC1pZqFpevZuTlKgECZAiAHJIEeqLpQeMRTxqR+gDEOe1clnae8kLZrGdQxBCEeMw=="}]},"maintainers":[{"name":"b08","email":"bobah083@gmail.com"}],"_npmUser":{"name":"b08","email":"bobah083@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/route-matcher_1.0.0_1569860649740_0.9370078331253877"},"_hasShrinkwrap":false},"1.0.1":{"name":"@b08/route-matcher","access":"public","version":"1.0.1","description":"Utility to match url against routes","main":"index.js","typings":"index","scripts":{"test":"npx gulp test","start":"npx gulp cover"},"keywords":[],"author":{"name":"Vladimir Repin"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@gitlab.com/b08/route-matcher.git"},"devDependencies":{"@b08/spawn":"^3.0.0","@b08/test-runner":"^2.0.0","@types/fs-extra":"^8.0.1","@types/gulp":"^4.0.6","fs-extra":"^8.1.0","git-tag":"^0.2.0","globby":"^10.0.1","gulp":"^4.0.2","nyc":"^13.3.0","request":"^2.88.0","request-promise-native":"^1.0.7","sloc":"^0.2.1","ts-node":"^8.4.1","tslint":"^5.20.0","typescript":"^3.6.4"},"dependencies":{"@b08/array":"^1.0.2","@b08/cache":"^1.0.0","@b08/flat-key":"^1.0.1","@b08/object-map":"^1.0.0"},"gitHead":"6a4b6061af370f182f3ba4a63edba72eda18d14b","bugs":{"url":"https://gitlab.com/b08/route-matcher/issues"},"homepage":"https://gitlab.com/b08/route-matcher#readme","_id":"@b08/route-matcher@1.0.1","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"integrity":"sha512-zjN2VLALIV5n4NZmQvLN4MaZcW1FHR6vZ/Te8HfZ0iRn76s+uOpkqJ/aHTFqnKOPOpGHzc//5yksQCvDffyoAw==","shasum":"e487ae873a2be272bd7ebb11a9a91ff5b9f6f24a","tarball":"https://registry.npmjs.org/@b08/route-matcher/-/route-matcher-1.0.1.tgz","fileCount":182,"unpackedSize":73685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdysmhCRA9TVsSAnZWagAAZ5IP/0u+Fv1bkSKczjbnBbh9\nS+t5opQPQj/gcAGlFDIcroAsd4caaLIJ9FYPoa8yvaeKecoKXVhriM40lSYs\nA6D+iGN7o7BdWJNaNbWQccdWSHLi2nTVGhvEyF3rjp0nDijENu9NAaVGUjJr\nS0BZN9XXDwX0fLlkX5ybZiWdmNmvb4+5ODKv0bRhJBw7lTxKWZ4wfBdr+Ems\nON/qIKGoWsq60x5jgMhb24RjUn8fEVrs7OG2L+4kL7glWbbAYOBhaoL70Ezd\now0uLd4YrV37XsW0rVDgx8rzbwpz8L5yV5JSNje/NOOiyHnWB5dmHjoNrbLZ\nGbQdcJYN/TKPC5lhmQkwxiRSd6nMkYTk1WpjFwCmWWcx5HbjWPVqY4idxR46\nkVsElkPlxbSyuHGsGkzG3qrRraYmBenDUuBy5Zya/k9h1t78JOJH6oZCjL7t\nNYdOVnXn9L3cGxTts6e0hGEg7R5/O9W/UFG0hJIi4J5MAlVgGL41qXwXgmU2\nluD2bLCGa0iUqdLswwsrrkUf4q/fHtuge7YKDad4+jx3uq486xGFHRDoIqfs\ntRWs37RfUuhkrgz3JC4S30GCildQzk1dH835ewKe+Oyv27GjKyBIwSIxUdNb\nDOtR5WHUleQXnRBSc6HSuB6Sj1DnqObe16gw0IWT4mvfTS+1a9DKAhry9rzr\n/UqY\r\n=85pL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG2FEu9Q/d9p9nMOVN5790uPertheobgUS1M/7sAorQgIgNGEui+yW1QYiSp9SW0qGS77UpE6AH1aw7c5/WD3IiB4="}]},"maintainers":[{"name":"b08","email":"bobah083@gmail.com"}],"_npmUser":{"name":"b08","email":"bobah083@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/route-matcher_1.0.1_1573570977419_0.18921158562407525"},"_hasShrinkwrap":false},"1.0.2":{"name":"@b08/route-matcher","access":"public","version":"1.0.2","description":"Utility to match url against routes","main":"index.js","typings":"index","scripts":{"test":"npx gulp test","start":"npx gulp cover"},"keywords":[],"author":{"name":"Vladimir Repin"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@gitlab.com/b08/route-matcher.git"},"devDependencies":{"@b08/library-tasks":"^3.0.4","@types/node":"^12.12.11","ts-node":"^8.5.0"},"dependencies":{"@b08/array":"^2.0.0","@b08/flat-key":"^1.1.0","@b08/memoize":"^1.0.0","@b08/object-map":"^1.0.4"},"gitHead":"457ea1bcce3d4a6a863d1cc45ad101410cb18577","bugs":{"url":"https://gitlab.com/b08/route-matcher/issues"},"homepage":"https://gitlab.com/b08/route-matcher#readme","_id":"@b08/route-matcher@1.0.2","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-gWmkH5fHeHshgOR2cK86KW9EroLowZ96aSbKn/+ZuF6vMrm+3TTIcTnBdRkWL/5gRzlfhnIBMOxs3sYNbzDVxA==","shasum":"ae5e2548cbe9918fe860df967493615978197026","tarball":"https://registry.npmjs.org/@b08/route-matcher/-/route-matcher-1.0.2.tgz","fileCount":182,"unpackedSize":71082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHa8BCRA9TVsSAnZWagAAzOYQAJELwWY6TEELscDULgmF\nnRMutLt9L+EbUX0WejV97VsGlM88fKYraj12TBcRBzif7pcRNxjrsIYqWtiq\nHKSXmAvXuQy1AwR3DPnKPUGCnS+L6AAN+DC2VrrJPDb6ORPkCU3WACYZPyp3\niONmW9IAFB7W+SnPxqLgrm59GKCaCmcaE779G40SOcUU7NMVe8c6wKPRHgu5\n+/JpwfWi7kI3BoxjSeBwMPxxK0wtL8RoHJYAx+QcGirbuJy17W+OXVAM/4X6\n6r1f4tix9/ZTdBoPzekHFQJr3D+Tk55nH9ICuuVO29oe82hHB40CsDR9S0gz\nVKgHhQyh3/sDVOan9SPHGtN86VU6Hb4SgJAfdUchutEDEyk3e+YXQ0f43X49\nQmCq1DvKlBZMGsrCH8ugN76VMLqijcy/FH0dOJiAIZBIxKtxsr0QRnagEDfX\nfNUayksjAkTim0rZPCxCZmfBOyGrKWsmwGTZ6Hq0d/UXPYvW0dwJJImLFWF0\nGxw4IC1Zu2Av1rwKlUF/yexu6uIyXCX3gOHT4BAwZFbuh2Ts8xqBLPUi0mwK\nRCeL94ZsQmHtBjQJm+3eoyevvAO3laiqT0eksyrE8ibZYPtGn5M+YCF30HVh\nMxi9Rqmsqw9fkfFbRCH2CLKuUiW+mShTuohYEv4uIvCn1jz/wQF8OBT3yoX8\n5TwC\r\n=iPDz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2rpHTdPEpt2I+lvKTjwwBhQAnlyKC11gtozVkfk9cxAiAT3tXi2W8GIufnSFVt0IAEFBwFU4z9jOnjXlKScmkYHg=="}]},"maintainers":[{"name":"b08","email":"bobah083@gmail.com"}],"_npmUser":{"name":"b08","email":"bobah083@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/route-matcher_1.0.2_1579003649208_0.3106515293959997"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-30T16:24:09.304Z","1.0.0":"2019-09-30T16:24:09.934Z","modified":"2022-04-04T17:23:48.892Z","1.0.1":"2019-11-12T15:02:57.594Z","1.0.2":"2020-01-14T12:07:29.439Z"},"maintainers":[{"name":"b08","email":"bobah083@gmail.com"}],"description":"Utility to match url against routes","homepage":"https://gitlab.com/b08/route-matcher#readme","keywords":[],"repository":{"type":"git","url":"git+ssh://git@gitlab.com/b08/route-matcher.git"},"author":{"name":"Vladimir Repin"},"bugs":{"url":"https://gitlab.com/b08/route-matcher/issues"},"license":"MIT","readme":"# @b08/route-matcher, seeded from @b08/library-seed, library type: feature\nUtility to match url against routes. Performance of this method is O(m) instead of O(n), where n is a number of routes, m is a number of slash-separated segments in url.\n\n# usage\nRoutes are preprocessed for fast search and memoized. Beware not to call the method with different array of routes every time.\nSeveral routes might match the url, it is up to you to throw or ignore.\n```\nimport { IMap } from \"@b08/object-map\";\nimport { matchRoute } from \"@b08/route-matcher\";\n\nconst myRoutes = [\n  { route: \"/\", action: () => openHomePage() },\n  { route: \"/dashboard/:userId\", action: (parameters: IMap) => openDashboardPage(parameters[\"userId\"]) }\n];\n\nfunction navigate(url: string): void {\n  const routes = findMatchingRoutes(url, myRoutes);\n  if(routes.length === 0) {\n    open(404);\n    return;\n  }\n  const firstRoute = routes[0];\n  firstRoute.route.action(firstRoute.parameters);\n}\n```\n\n# optional parameters\nParameter name trailing with question mark is optional, example \"/dashboard/:userId?\".\nWill match both url's \"/dashboard/123\" and \"/dashboard\" ","readmeFilename":"README.md"}