ipx 4.0.0-alpha.1 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,34 @@
1
- String.fromCharCode;function decode(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}const PROTOCOL_STRICT_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/,TRAILING_SLASH_RE=/\/$|\/\?|\/#/,JOIN_LEADING_SLASH_RE=/^\.?\//;function hasProtocol(e,u={}){return typeof u==`boolean`&&(u={acceptRelative:u}),u.strict?PROTOCOL_STRICT_REGEX.test(e):PROTOCOL_REGEX.test(e)||(u.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(e):!1)}function hasTrailingSlash(e=``,s){return s?TRAILING_SLASH_RE.test(e):e.endsWith(`/`)}function withTrailingSlash(e=``,s){if(!s)return e.endsWith(`/`)?e:e+`/`;if(hasTrailingSlash(e,!0))return e||`/`;let c=e,l=``,u=e.indexOf(`#`);if(u!==-1&&(c=e.slice(0,u),l=e.slice(u),!c))return l;let[d,...f]=c.split(`?`);return d+`/`+(f.length>0?`?${f.join(`?`)}`:``)+l}function hasLeadingSlash(e=``){return e.startsWith(`/`)}function withLeadingSlash(e=``){return hasLeadingSlash(e)?e:`/`+e}function isNonEmptyURL(e){return e&&e!==`/`}function joinURL(e,...s){let c=e||``;for(let e of s.filter(e=>isNonEmptyURL(e)))if(c){let s=e.replace(JOIN_LEADING_SLASH_RE,``);c=withTrailingSlash(c)+s}else c=e;return c}export{withLeadingSlash as i,hasProtocol as n,joinURL as r,decode as t};
1
+ String.fromCharCode;
2
+ const e = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/, t = /^[\s\w\0+.-]{2,}:([/\\]{2})?/, n = /^([/\\]\s*){2,}[^/\\]/, r = /\/$|\/\?|\/#/, i = /^\.?\//;
3
+ function a(r, i = {}) {
4
+ return typeof i == `boolean` && (i = { acceptRelative: i }), i.strict ? e.test(r) : t.test(r) || (i.acceptRelative ? n.test(r) : !1);
5
+ }
6
+ function o(e = ``, t) {
7
+ return t ? r.test(e) : e.endsWith(`/`);
8
+ }
9
+ function s(e = ``, t) {
10
+ if (!t) return e.endsWith(`/`) ? e : e + `/`;
11
+ if (o(e, !0)) return e || `/`;
12
+ let n = e, r = ``, i = e.indexOf(`#`);
13
+ if (i !== -1 && (n = e.slice(0, i), r = e.slice(i), !n)) return r;
14
+ let [a, ...s] = n.split(`?`);
15
+ return a + `/` + (s.length > 0 ? `?${s.join(`?`)}` : ``) + r;
16
+ }
17
+ function c(e = ``) {
18
+ return e.startsWith(`/`);
19
+ }
20
+ function l(e = ``) {
21
+ return c(e) ? e : `/` + e;
22
+ }
23
+ function u(e) {
24
+ return e && e !== `/`;
25
+ }
26
+ function d(e, ...t) {
27
+ let n = e || ``;
28
+ for (let e of t.filter((e) => u(e))) if (n) {
29
+ let t = e.replace(i, ``);
30
+ n = s(n) + t;
31
+ } else n = e;
32
+ return n;
33
+ }
34
+ export { a as hasProtocol, d as joinURL, l as withLeadingSlash };