PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.20
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.20
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / assets / chunks / Url.js

Url.js in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.20, at assets/chunks/Url.js

2 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{S as o}from"./Str.js?ver=1.3.20";import{A as h}from"./Arr.js?ver=1.3.20";import{a as p}from"./vue-router.js?ver=1.3.20";class U{static appendQueryParams(r,t={}){const e=new URL(r);return Object.entries(t).forEach(([n,s])=>{s!=null&&e.searchParams.append(n,s.toString())}),e.toString()}static join(r,t,e={}){return o.endsWith(r,"/")||(r=r+"/"),o.startsWith(t,"/")&&(t=t.substring(1)),this.appendQueryParams(r+t,e)}static addParam(r,t,e){const n=new URL(r);return n.searchParams.append(t,e),n.toString()}static getParam(r,t){return new URL(r??window.location.href).searchParams.get(t)}static removeParam(r,t){const e=new URL(r);return e.searchParams.delete(t),e.toString()}static pushToVueUrl(r=null,t={}){const e=this.appendToVueUrl(r,t);e&&window.history.replaceState({},"",e)}static appendToVueUrl(r=null,t={}){if(typeof window>"u")return;const e=r??window.location.href,n=new URL(e),s=e.split("#")[0],a=n.hash;if(!a.includes("?")){const i=a.replace(/\/?$/,"/")+"?"+new URLSearchParams(t).toString();return`${s}${i}`}const[u,l]=a.slice(1).split("?"),c=new URLSearchParams(l||"");Object.entries(t).forEach(([i,m])=>{c.set(i,m.toString())});const d=`#${u}?${c.toString()}`;return`${s}${d}`}static getAdminRoute(r=""){return h.get(window,"fluentCartAdminApp.admin_url")+r}static getVueParams(r){var e;const t=p();return((e=t==null?void 0:t.query)==null?void 0:e[r])??(t==null?void 0:t.query)??null}}export{U};
2