UNPKG

edge-master

Version:
2 lines (1 loc) 268 B
"use strict";export const routePattern=t=>{const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e=new RegExp("^".concat(r.replace(/\\\*/g,".*"),"$"));return n=>e.test(n.url)},urlStartWith=t=>r=>r.url.startsWith(t),pathStartWith=t=>r=>new URL(r.url).pathname.startsWith(t);