import { useCreation as n, useMemoizedFn as r } from "ahooks";
import a from "path-to-regexp";
function u({ protectedRoutes: t = [] }) {
  const o = n(() => t.map((e) => a(e, [])), [t]);
  return {
    checkMatch: r((e = window.location.pathname) => o.some((c) => c.exec(e)))
  };
}
export {
  u as default
};
