@onesy/utils
Version:
18 lines (17 loc) • 490 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const path_to_regexp_1 = require("path-to-regexp");
const matchRoute = (value, path) => {
try {
for (const route of value) {
const matched = (0, path_to_regexp_1.match)(route, { decode: decodeURIComponent })(path);
if (matched)
return !!matched;
}
}
catch (error) {
return false;
}
return false;
};
exports.default = matchRoute;
;