mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-04 11:09:30 +08:00
1 line
No EOL
600 B
Text
1 line
No EOL
600 B
Text
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.regexparam=n()}(this,function(){return function(e,n){if(e instanceof RegExp)return{keys:!1,pattern:e};var t,i,f,r,s=[],o="",u=e.split("/");for(u[0]||u.shift();f=u.shift();)"*"===(t=f[0])?(s.push("wild"),o+="/(.*)"):":"===t?(i=f.indexOf("?",1),r=f.indexOf(".",1),s.push(f.substring(1,~i?i:~r?r:f.length)),o+=~i&&!~r?"(?:/([^/]+?))?":"/([^/]+?)",~r&&(o+=(~i?"?":"")+"\\"+f.substring(r))):o+="/"+f;return{keys:s,pattern:new RegExp("^"+o+(n?"(?=$|/)":"/?$"),"i")}}}); |