@gardenfi/utils 0.0.1-beta.2 → 0.0.1-beta.4
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.
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +1 -1
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +6 -0
- package/dist/src/lib/url/Url.d.ts +1 -0
- package/package.json +1 -1
package/dist/index37.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.21.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.21.21";exports.version=e;
|
package/dist/index37.js
CHANGED
package/dist/index6.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r extends URL{constructor(t,e){super(t,e)}endpoint(t){t.startsWith("/")||(t=`/${t}`);const e=`${this.pathname!=="/"?this.pathname:""}${t}`;return new r(e,this)}socket(){if(this.protocol==="https:")return this.origin.replace("https","wss");if(this.protocol==="http:")return this.origin.replace("http","ws");throw new Error("Invalid protocol")}}exports.Url=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r extends URL{constructor(t,e){super(t,e)}endpoint(t){t.startsWith("/")||(t=`/${t}`);const e=`${this.pathname!=="/"?this.pathname:""}${t}`;return new r(e,this)}socket(){if(this.protocol==="https:")return this.origin.replace("https","wss");if(this.protocol==="http:")return this.origin.replace("http","ws");throw new Error("Invalid protocol")}addSearchParams(t){const e=new URLSearchParams(this.search);for(const s in t)e.set(s,t[s]);return new r(`${this.pathname}?${e.toString()}`,this)}}exports.Url=r;
|
package/dist/index6.js
CHANGED
|
@@ -14,6 +14,12 @@ class r extends URL {
|
|
|
14
14
|
return this.origin.replace("http", "ws");
|
|
15
15
|
throw new Error("Invalid protocol");
|
|
16
16
|
}
|
|
17
|
+
addSearchParams(t) {
|
|
18
|
+
const s = new URLSearchParams(this.search);
|
|
19
|
+
for (const e in t)
|
|
20
|
+
s.set(e, t[e]);
|
|
21
|
+
return new r(`${this.pathname}?${s.toString()}`, this);
|
|
22
|
+
}
|
|
17
23
|
}
|
|
18
24
|
export {
|
|
19
25
|
r as Url
|