UNPKG

@amaui/utils

Version:
18 lines (15 loc) 340 B
import { match } from 'path-to-regexp'; const matchRoute = (value, path) => { try { for (const route of value) { const matched = match(route, { decode: decodeURIComponent })(path); if (matched) return !!matched; } } catch (error) { return false; } return false; }; export default matchRoute;