url-operator 0.1.1 → 0.2.0
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/lib/{es2015/append-pathname.d.ts → append-pathname.d.ts} +0 -0
- package/lib/{es2018/append-pathname.js → append-pathname.js} +3 -7
- package/lib/append-pathname.js.map +1 -0
- package/lib/{es2015/append-search-param.d.ts → append-search-param.d.ts} +0 -0
- package/lib/append-search-param.js +8 -0
- package/lib/append-search-param.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -0
- package/lib/{es2015/set-hash.d.ts → set-hash.d.ts} +0 -0
- package/lib/set-hash.js +6 -0
- package/lib/set-hash.js.map +1 -0
- package/lib/{es2015/set-host.d.ts → set-host.d.ts} +0 -0
- package/lib/set-host.js +6 -0
- package/lib/set-host.js.map +1 -0
- package/lib/{es2015/set-password.d.ts → set-password.d.ts} +0 -0
- package/lib/set-password.js +6 -0
- package/lib/set-password.js.map +1 -0
- package/lib/{es2015/set-pathname.d.ts → set-pathname.d.ts} +0 -0
- package/lib/set-pathname.js +6 -0
- package/lib/set-pathname.js.map +1 -0
- package/lib/{es2015/set-port.d.ts → set-port.d.ts} +0 -0
- package/lib/set-port.js +6 -0
- package/lib/set-port.js.map +1 -0
- package/lib/{es2015/set-protocol.d.ts → set-protocol.d.ts} +0 -0
- package/lib/set-protocol.js +8 -0
- package/lib/set-protocol.js.map +1 -0
- package/lib/{es2015/set-search-param.d.ts → set-search-param.d.ts} +0 -0
- package/lib/set-search-param.js +8 -0
- package/lib/{es2015/set-search-param.js.map → set-search-param.js.map} +1 -1
- package/lib/{es2015/set-search-params.d.ts → set-search-params.d.ts} +0 -0
- package/lib/{es2015/set-search-params.js → set-search-params.js} +1 -5
- package/lib/set-search-params.js.map +1 -0
- package/lib/{es2015/set-search.d.ts → set-search.d.ts} +0 -0
- package/lib/set-search.js +6 -0
- package/lib/set-search.js.map +1 -0
- package/lib/{es2015/set-username.d.ts → set-username.d.ts} +0 -0
- package/lib/set-username.js +6 -0
- package/lib/set-username.js.map +1 -0
- package/package.json +31 -27
- package/lib/es2015/append-pathname.js +0 -19
- package/lib/es2015/append-pathname.js.map +0 -1
- package/lib/es2015/append-search-param.js +0 -12
- package/lib/es2015/append-search-param.js.map +0 -1
- package/lib/es2015/index.d.ts +0 -12
- package/lib/es2015/index.js +0 -29
- package/lib/es2015/index.js.map +0 -1
- package/lib/es2015/set-hash.js +0 -10
- package/lib/es2015/set-hash.js.map +0 -1
- package/lib/es2015/set-host.js +0 -10
- package/lib/es2015/set-host.js.map +0 -1
- package/lib/es2015/set-password.js +0 -10
- package/lib/es2015/set-password.js.map +0 -1
- package/lib/es2015/set-pathname.js +0 -10
- package/lib/es2015/set-pathname.js.map +0 -1
- package/lib/es2015/set-port.js +0 -10
- package/lib/es2015/set-port.js.map +0 -1
- package/lib/es2015/set-protocol.js +0 -12
- package/lib/es2015/set-protocol.js.map +0 -1
- package/lib/es2015/set-search-param.js +0 -12
- package/lib/es2015/set-search-params.js.map +0 -1
- package/lib/es2015/set-search.js +0 -10
- package/lib/es2015/set-search.js.map +0 -1
- package/lib/es2015/set-username.js +0 -10
- package/lib/es2015/set-username.js.map +0 -1
- package/lib/es2018/append-pathname.d.ts +0 -1
- package/lib/es2018/append-pathname.js.map +0 -1
- package/lib/es2018/append-search-param.d.ts +0 -1
- package/lib/es2018/append-search-param.js +0 -12
- package/lib/es2018/append-search-param.js.map +0 -1
- package/lib/es2018/index.d.ts +0 -12
- package/lib/es2018/index.js +0 -29
- package/lib/es2018/index.js.map +0 -1
- package/lib/es2018/set-hash.d.ts +0 -1
- package/lib/es2018/set-hash.js +0 -10
- package/lib/es2018/set-hash.js.map +0 -1
- package/lib/es2018/set-host.d.ts +0 -1
- package/lib/es2018/set-host.js +0 -10
- package/lib/es2018/set-host.js.map +0 -1
- package/lib/es2018/set-password.d.ts +0 -1
- package/lib/es2018/set-password.js +0 -10
- package/lib/es2018/set-password.js.map +0 -1
- package/lib/es2018/set-pathname.d.ts +0 -1
- package/lib/es2018/set-pathname.js +0 -10
- package/lib/es2018/set-pathname.js.map +0 -1
- package/lib/es2018/set-port.d.ts +0 -1
- package/lib/es2018/set-port.js +0 -10
- package/lib/es2018/set-port.js.map +0 -1
- package/lib/es2018/set-protocol.d.ts +0 -1
- package/lib/es2018/set-protocol.js +0 -12
- package/lib/es2018/set-protocol.js.map +0 -1
- package/lib/es2018/set-search-param.d.ts +0 -1
- package/lib/es2018/set-search-param.js +0 -12
- package/lib/es2018/set-search-param.js.map +0 -1
- package/lib/es2018/set-search-params.d.ts +0 -1
- package/lib/es2018/set-search-params.js +0 -14
- package/lib/es2018/set-search-params.js.map +0 -1
- package/lib/es2018/set-search.d.ts +0 -1
- package/lib/es2018/set-search.js +0 -10
- package/lib/es2018/set-search.js.map +0 -1
- package/lib/es2018/set-username.d.ts +0 -1
- package/lib/es2018/set-username.js +0 -10
- package/lib/es2018/set-username.js.map +0 -1
|
File without changes
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const prelude_1 = require("@blackglory/prelude");
|
|
5
|
-
function appendPathname(url, pathname) {
|
|
6
|
-
const baseURL = (0, prelude_1.go)(() => {
|
|
1
|
+
import { go } from '@blackglory/prelude';
|
|
2
|
+
export function appendPathname(url, pathname) {
|
|
3
|
+
const baseURL = go(() => {
|
|
7
4
|
const baseURL = new URL(url);
|
|
8
5
|
if (!baseURL.pathname.endsWith('/')) {
|
|
9
6
|
baseURL.pathname = `${baseURL.pathname}/`;
|
|
@@ -15,5 +12,4 @@ function appendPathname(url, pathname) {
|
|
|
15
12
|
newURL.hash = baseURL.hash;
|
|
16
13
|
return newURL;
|
|
17
14
|
}
|
|
18
|
-
exports.appendPathname = appendPathname;
|
|
19
15
|
//# sourceMappingURL=append-pathname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append-pathname.js","sourceRoot":"","sources":["../src/append-pathname.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAExC,MAAM,UAAU,cAAc,CAAC,GAAiB,EAAE,QAAgB;IAChE,MAAM,OAAO,GAAG,EAAE,CAAC,GAAG,EAAE;QACtB,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACnC,OAAO,CAAC,QAAQ,GAAG,GAAG,OAAO,CAAC,QAAQ,GAAG,CAAA;SAC1C;QAED,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAC5B,OAAO,CACR,CAAA;IACD,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function appendSearchParam(url, name, value) {
|
|
2
|
+
const newURL = new URL(url);
|
|
3
|
+
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
4
|
+
newSearchParams.append(name, value.toString());
|
|
5
|
+
newURL.search = newSearchParams.toString();
|
|
6
|
+
return newURL;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=append-search-param.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append-search-param.js","sourceRoot":"","sources":["../src/append-search-param.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAC/B,GAAiB,EACjB,IAAY,EACZ,KAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC9C,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './set-protocol.js';
|
|
2
|
+
export * from './set-username.js';
|
|
3
|
+
export * from './set-password.js';
|
|
4
|
+
export * from './set-host.js';
|
|
5
|
+
export * from './set-port.js';
|
|
6
|
+
export * from './set-pathname.js';
|
|
7
|
+
export * from './append-pathname.js';
|
|
8
|
+
export * from './set-search.js';
|
|
9
|
+
export * from './set-search-param.js';
|
|
10
|
+
export * from './set-search-params.js';
|
|
11
|
+
export * from './append-search-param.js';
|
|
12
|
+
export * from './set-hash.js';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './set-protocol.js';
|
|
2
|
+
export * from './set-username.js';
|
|
3
|
+
export * from './set-password.js';
|
|
4
|
+
export * from './set-host.js';
|
|
5
|
+
export * from './set-port.js';
|
|
6
|
+
export * from './set-pathname.js';
|
|
7
|
+
export * from './append-pathname.js';
|
|
8
|
+
export * from './set-search.js';
|
|
9
|
+
export * from './set-search-param.js';
|
|
10
|
+
export * from './set-search-params.js';
|
|
11
|
+
export * from './append-search-param.js';
|
|
12
|
+
export * from './set-hash.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA"}
|
|
File without changes
|
package/lib/set-hash.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-hash.js","sourceRoot":"","sources":["../src/set-hash.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAElB,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
package/lib/set-host.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-host.js","sourceRoot":"","sources":["../src/set-host.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAElB,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-password.js","sourceRoot":"","sources":["../src/set-password.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-pathname.js","sourceRoot":"","sources":["../src/set-pathname.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
package/lib/set-port.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-port.js","sourceRoot":"","sources":["../src/set-port.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IAE7B,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-protocol.js","sourceRoot":"","sources":["../src/set-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAG3B,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,MAAM,CAAC,IAAI,CAAC,OAAO,CACjB,aAAa,EACb,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QACtB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,GAAG,QAAQ,KAAK,CACnB,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function setSearchParam(url, name, value) {
|
|
2
|
+
const newURL = new URL(url);
|
|
3
|
+
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
4
|
+
newSearchParams.set(name, value.toString());
|
|
5
|
+
newURL.search = newSearchParams.toString();
|
|
6
|
+
return newURL;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=set-search-param.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-search-param.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"set-search-param.js","sourceRoot":"","sources":["../src/set-search-param.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAC5B,GAAiB,EACjB,IAAY,EACZ,KAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC3C,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSearchParams = void 0;
|
|
4
|
-
function setSearchParams(url, searchParams) {
|
|
1
|
+
export function setSearchParams(url, searchParams) {
|
|
5
2
|
const newURL = new URL(url);
|
|
6
3
|
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
7
4
|
for (const [name, value] of Object.entries(searchParams)) {
|
|
@@ -10,5 +7,4 @@ function setSearchParams(url, searchParams) {
|
|
|
10
7
|
newURL.search = newSearchParams.toString();
|
|
11
8
|
return newURL;
|
|
12
9
|
}
|
|
13
|
-
exports.setSearchParams = setSearchParams;
|
|
14
10
|
//# sourceMappingURL=set-search-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-search-params.js","sourceRoot":"","sources":["../src/set-search-params.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAC7B,GAAiB,EACjB,YAA6C;IAE7C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACxD,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;KAC5C;IACD,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-search.js","sourceRoot":"","sources":["../src/set-search.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,GAAiB,EAAE,MAAc;IACzD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;IAEtB,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-username.js","sourceRoot":"","sources":["../src/set-username.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "url-operator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"files": [
|
|
7
7
|
"lib"
|
|
8
8
|
],
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "lib/index.js",
|
|
11
|
+
"types": "lib/index.d.ts",
|
|
11
12
|
"sideEffects": false,
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=16"
|
|
15
|
+
},
|
|
12
16
|
"repository": "git@github.com:BlackGlory/url-operator.git",
|
|
13
17
|
"author": "BlackGlory <woshenmedoubuzhidao@blackglory.me>",
|
|
14
18
|
"license": "MIT",
|
|
15
19
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"test
|
|
19
|
-
"test:
|
|
20
|
-
"
|
|
20
|
+
"prepare": "ts-patch install -s",
|
|
21
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src __tests__",
|
|
22
|
+
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --no-cache --config jest.config.cjs",
|
|
23
|
+
"test:debug": "cross-env NODE_OPTIONS=--experimental-vm-modules node --inspect-brk jest --runInBand --config jest.config.cjs",
|
|
24
|
+
"test:coverage": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage --config jest.config.cjs",
|
|
25
|
+
"prepublishOnly": "run-s prepare clean build",
|
|
21
26
|
"clean": "rimraf lib",
|
|
22
|
-
"build": "
|
|
23
|
-
"build:es2015": "run-s build:es2015:*",
|
|
24
|
-
"build:es2015:compile": "tsc --project tsconfig.build.json --module commonjs --target es2015 --outDir lib/es2015",
|
|
25
|
-
"build:es2015:patch": "tscpaths -p tsconfig.build.json -s ./src -o ./lib/es2015",
|
|
26
|
-
"build:es2018": "run-s build:es2018:*",
|
|
27
|
-
"build:es2018:compile": "tsc --project tsconfig.build.json --module commonjs --target es2018 --outDir lib/es2018",
|
|
28
|
-
"build:es2018:patch": "tscpaths -p tsconfig.build.json -s ./src -o ./lib/es2018",
|
|
27
|
+
"build": "tsc --project tsconfig.build.json",
|
|
29
28
|
"release": "standard-version"
|
|
30
29
|
},
|
|
31
30
|
"husky": {
|
|
32
31
|
"hooks": {
|
|
33
|
-
"pre-commit": "run-s lint build test",
|
|
32
|
+
"pre-commit": "run-s prepare lint build test",
|
|
34
33
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@commitlint/
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@typescript-eslint/
|
|
43
|
-
"eslint": "^
|
|
37
|
+
"@blackglory/jest-resolver": "^0.3.0",
|
|
38
|
+
"@commitlint/cli": "^17.4.4",
|
|
39
|
+
"@commitlint/config-conventional": "^17.4.4",
|
|
40
|
+
"@types/jest": "^29.4.0",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
|
42
|
+
"@typescript-eslint/parser": "^5.53.0",
|
|
43
|
+
"cross-env": "^7.0.3",
|
|
44
|
+
"eslint": "^8.34.0",
|
|
44
45
|
"husky": "4",
|
|
45
|
-
"jest": "^29.3
|
|
46
|
+
"jest": "^29.4.3",
|
|
47
|
+
"jest-resolve": "^29.4.3",
|
|
46
48
|
"npm-run-all": "^4.1.5",
|
|
47
|
-
"rimraf": "^4.1.
|
|
49
|
+
"rimraf": "^4.1.2",
|
|
48
50
|
"standard-version": "^9.5.0",
|
|
49
51
|
"ts-jest": "^29.0.5",
|
|
52
|
+
"ts-patch": "^2.1.0",
|
|
50
53
|
"tscpaths": "^0.0.9",
|
|
51
|
-
"tslib": "^2.
|
|
52
|
-
"typescript": "
|
|
54
|
+
"tslib": "^2.5.0",
|
|
55
|
+
"typescript": "4.8",
|
|
56
|
+
"typescript-transform-paths": "^3.4.6"
|
|
53
57
|
},
|
|
54
58
|
"dependencies": {
|
|
55
|
-
"@blackglory/prelude": "^0.
|
|
59
|
+
"@blackglory/prelude": "^0.3.1"
|
|
56
60
|
}
|
|
57
61
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appendPathname = void 0;
|
|
4
|
-
const prelude_1 = require("@blackglory/prelude");
|
|
5
|
-
function appendPathname(url, pathname) {
|
|
6
|
-
const baseURL = (0, prelude_1.go)(() => {
|
|
7
|
-
const baseURL = new URL(url);
|
|
8
|
-
if (!baseURL.pathname.endsWith('/')) {
|
|
9
|
-
baseURL.pathname = `${baseURL.pathname}/`;
|
|
10
|
-
}
|
|
11
|
-
return baseURL;
|
|
12
|
-
});
|
|
13
|
-
const newURL = new URL(pathname.replace(/^\/*/, ''), baseURL);
|
|
14
|
-
newURL.search = baseURL.search;
|
|
15
|
-
newURL.hash = baseURL.hash;
|
|
16
|
-
return newURL;
|
|
17
|
-
}
|
|
18
|
-
exports.appendPathname = appendPathname;
|
|
19
|
-
//# sourceMappingURL=append-pathname.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"append-pathname.js","sourceRoot":"","sources":["../../src/append-pathname.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;AAExC,SAAgB,cAAc,CAAC,GAAiB,EAAE,QAAgB;IAChE,MAAM,OAAO,GAAG,IAAA,YAAE,EAAC,GAAG,EAAE;QACtB,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACnC,OAAO,CAAC,QAAQ,GAAG,GAAG,OAAO,CAAC,QAAQ,GAAG,CAAA;SAC1C;QAED,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAC5B,OAAO,CACR,CAAA;IACD,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAlBD,wCAkBC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appendSearchParam = void 0;
|
|
4
|
-
function appendSearchParam(url, name, value) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
7
|
-
newSearchParams.append(name, value.toString());
|
|
8
|
-
newURL.search = newSearchParams.toString();
|
|
9
|
-
return newURL;
|
|
10
|
-
}
|
|
11
|
-
exports.appendSearchParam = appendSearchParam;
|
|
12
|
-
//# sourceMappingURL=append-search-param.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"append-search-param.js","sourceRoot":"","sources":["../../src/append-search-param.ts"],"names":[],"mappings":";;;AAAA,SAAgB,iBAAiB,CAC/B,GAAiB,EACjB,IAAY,EACZ,KAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC9C,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC;AAZD,8CAYC"}
|
package/lib/es2015/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './set-protocol';
|
|
2
|
-
export * from './set-username';
|
|
3
|
-
export * from './set-password';
|
|
4
|
-
export * from './set-host';
|
|
5
|
-
export * from './set-port';
|
|
6
|
-
export * from './set-pathname';
|
|
7
|
-
export * from './append-pathname';
|
|
8
|
-
export * from './set-search';
|
|
9
|
-
export * from './set-search-param';
|
|
10
|
-
export * from './set-search-params';
|
|
11
|
-
export * from './append-search-param';
|
|
12
|
-
export * from './set-hash';
|
package/lib/es2015/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./set-protocol"), exports);
|
|
18
|
-
__exportStar(require("./set-username"), exports);
|
|
19
|
-
__exportStar(require("./set-password"), exports);
|
|
20
|
-
__exportStar(require("./set-host"), exports);
|
|
21
|
-
__exportStar(require("./set-port"), exports);
|
|
22
|
-
__exportStar(require("./set-pathname"), exports);
|
|
23
|
-
__exportStar(require("./append-pathname"), exports);
|
|
24
|
-
__exportStar(require("./set-search"), exports);
|
|
25
|
-
__exportStar(require("./set-search-param"), exports);
|
|
26
|
-
__exportStar(require("./set-search-params"), exports);
|
|
27
|
-
__exportStar(require("./append-search-param"), exports);
|
|
28
|
-
__exportStar(require("./set-hash"), exports);
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
package/lib/es2015/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,iDAA8B;AAC9B,iDAA8B;AAC9B,6CAA0B;AAC1B,6CAA0B;AAC1B,iDAA8B;AAC9B,oDAAiC;AACjC,+CAA4B;AAC5B,qDAAkC;AAClC,sDAAmC;AACnC,wDAAqC;AACrC,6CAA0B"}
|
package/lib/es2015/set-hash.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setHash = void 0;
|
|
4
|
-
function setHash(url, hash) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.hash = hash;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setHash = setHash;
|
|
10
|
-
//# sourceMappingURL=set-hash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-hash.js","sourceRoot":"","sources":["../../src/set-hash.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAElB,OAAO,MAAM,CAAA;AACf,CAAC;AAND,0BAMC"}
|
package/lib/es2015/set-host.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setHost = void 0;
|
|
4
|
-
function setHost(url, host) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.host = host;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setHost = setHost;
|
|
10
|
-
//# sourceMappingURL=set-host.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-host.js","sourceRoot":"","sources":["../../src/set-host.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAElB,OAAO,MAAM,CAAA;AACf,CAAC;AAND,0BAMC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPassword = void 0;
|
|
4
|
-
function setPassword(url, password) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.password = password;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setPassword = setPassword;
|
|
10
|
-
//# sourceMappingURL=set-password.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-password.js","sourceRoot":"","sources":["../../src/set-password.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,kCAMC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPathname = void 0;
|
|
4
|
-
function setPathname(url, pathname) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.pathname = pathname;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setPathname = setPathname;
|
|
10
|
-
//# sourceMappingURL=set-pathname.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-pathname.js","sourceRoot":"","sources":["../../src/set-pathname.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,kCAMC"}
|
package/lib/es2015/set-port.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPort = void 0;
|
|
4
|
-
function setPort(url, port) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.port = port.toString();
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setPort = setPort;
|
|
10
|
-
//# sourceMappingURL=set-port.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-port.js","sourceRoot":"","sources":["../../src/set-port.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IAE7B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,0BAMC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setProtocol = void 0;
|
|
4
|
-
function setProtocol(url, protocol) {
|
|
5
|
-
const oldURL = new URL(url);
|
|
6
|
-
const newURL = new URL(oldURL.href.replace(/^(\S+:)\/\//, protocol.endsWith(':')
|
|
7
|
-
? protocol
|
|
8
|
-
: `${protocol}://`));
|
|
9
|
-
return newURL;
|
|
10
|
-
}
|
|
11
|
-
exports.setProtocol = setProtocol;
|
|
12
|
-
//# sourceMappingURL=set-protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-protocol.js","sourceRoot":"","sources":["../../src/set-protocol.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAG3B,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,MAAM,CAAC,IAAI,CAAC,OAAO,CACjB,aAAa,EACb,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QACtB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,GAAG,QAAQ,KAAK,CACnB,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAdD,kCAcC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSearchParam = void 0;
|
|
4
|
-
function setSearchParam(url, name, value) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
7
|
-
newSearchParams.set(name, value.toString());
|
|
8
|
-
newURL.search = newSearchParams.toString();
|
|
9
|
-
return newURL;
|
|
10
|
-
}
|
|
11
|
-
exports.setSearchParam = setSearchParam;
|
|
12
|
-
//# sourceMappingURL=set-search-param.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-search-params.js","sourceRoot":"","sources":["../../src/set-search-params.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAC7B,GAAiB,EACjB,YAA6C;IAE7C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACxD,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;KAC5C;IACD,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC;AAbD,0CAaC"}
|
package/lib/es2015/set-search.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSearch = void 0;
|
|
4
|
-
function setSearch(url, search) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.search = search;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setSearch = setSearch;
|
|
10
|
-
//# sourceMappingURL=set-search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-search.js","sourceRoot":"","sources":["../../src/set-search.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS,CAAC,GAAiB,EAAE,MAAc;IACzD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;IAEtB,OAAO,MAAM,CAAA;AACf,CAAC;AAND,8BAMC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setUsername = void 0;
|
|
4
|
-
function setUsername(url, username) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.username = username;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setUsername = setUsername;
|
|
10
|
-
//# sourceMappingURL=set-username.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-username.js","sourceRoot":"","sources":["../../src/set-username.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,kCAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function appendPathname(url: string | URL, pathname: string): URL;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"append-pathname.js","sourceRoot":"","sources":["../../src/append-pathname.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;AAExC,SAAgB,cAAc,CAAC,GAAiB,EAAE,QAAgB;IAChE,MAAM,OAAO,GAAG,IAAA,YAAE,EAAC,GAAG,EAAE;QACtB,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACnC,OAAO,CAAC,QAAQ,GAAG,GAAG,OAAO,CAAC,QAAQ,GAAG,CAAA;SAC1C;QAED,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAC5B,OAAO,CACR,CAAA;IACD,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAlBD,wCAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function appendSearchParam(url: string | URL, name: string, value: string | number): URL;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appendSearchParam = void 0;
|
|
4
|
-
function appendSearchParam(url, name, value) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
7
|
-
newSearchParams.append(name, value.toString());
|
|
8
|
-
newURL.search = newSearchParams.toString();
|
|
9
|
-
return newURL;
|
|
10
|
-
}
|
|
11
|
-
exports.appendSearchParam = appendSearchParam;
|
|
12
|
-
//# sourceMappingURL=append-search-param.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"append-search-param.js","sourceRoot":"","sources":["../../src/append-search-param.ts"],"names":[],"mappings":";;;AAAA,SAAgB,iBAAiB,CAC/B,GAAiB,EACjB,IAAY,EACZ,KAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC9C,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC;AAZD,8CAYC"}
|
package/lib/es2018/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './set-protocol';
|
|
2
|
-
export * from './set-username';
|
|
3
|
-
export * from './set-password';
|
|
4
|
-
export * from './set-host';
|
|
5
|
-
export * from './set-port';
|
|
6
|
-
export * from './set-pathname';
|
|
7
|
-
export * from './append-pathname';
|
|
8
|
-
export * from './set-search';
|
|
9
|
-
export * from './set-search-param';
|
|
10
|
-
export * from './set-search-params';
|
|
11
|
-
export * from './append-search-param';
|
|
12
|
-
export * from './set-hash';
|
package/lib/es2018/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./set-protocol"), exports);
|
|
18
|
-
__exportStar(require("./set-username"), exports);
|
|
19
|
-
__exportStar(require("./set-password"), exports);
|
|
20
|
-
__exportStar(require("./set-host"), exports);
|
|
21
|
-
__exportStar(require("./set-port"), exports);
|
|
22
|
-
__exportStar(require("./set-pathname"), exports);
|
|
23
|
-
__exportStar(require("./append-pathname"), exports);
|
|
24
|
-
__exportStar(require("./set-search"), exports);
|
|
25
|
-
__exportStar(require("./set-search-param"), exports);
|
|
26
|
-
__exportStar(require("./set-search-params"), exports);
|
|
27
|
-
__exportStar(require("./append-search-param"), exports);
|
|
28
|
-
__exportStar(require("./set-hash"), exports);
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
package/lib/es2018/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,iDAA8B;AAC9B,iDAA8B;AAC9B,6CAA0B;AAC1B,6CAA0B;AAC1B,iDAA8B;AAC9B,oDAAiC;AACjC,+CAA4B;AAC5B,qDAAkC;AAClC,sDAAmC;AACnC,wDAAqC;AACrC,6CAA0B"}
|
package/lib/es2018/set-hash.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setHash(url: string | URL, hash: string): URL;
|
package/lib/es2018/set-hash.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setHash = void 0;
|
|
4
|
-
function setHash(url, hash) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.hash = hash;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setHash = setHash;
|
|
10
|
-
//# sourceMappingURL=set-hash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-hash.js","sourceRoot":"","sources":["../../src/set-hash.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAElB,OAAO,MAAM,CAAA;AACf,CAAC;AAND,0BAMC"}
|
package/lib/es2018/set-host.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setHost(url: string | URL, host: string): URL;
|
package/lib/es2018/set-host.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setHost = void 0;
|
|
4
|
-
function setHost(url, host) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.host = host;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setHost = setHost;
|
|
10
|
-
//# sourceMappingURL=set-host.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-host.js","sourceRoot":"","sources":["../../src/set-host.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAElB,OAAO,MAAM,CAAA;AACf,CAAC;AAND,0BAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setPassword(url: string | URL, password: string): URL;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPassword = void 0;
|
|
4
|
-
function setPassword(url, password) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.password = password;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setPassword = setPassword;
|
|
10
|
-
//# sourceMappingURL=set-password.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-password.js","sourceRoot":"","sources":["../../src/set-password.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,kCAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setPathname(url: string | URL, pathname: string): URL;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPathname = void 0;
|
|
4
|
-
function setPathname(url, pathname) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.pathname = pathname;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setPathname = setPathname;
|
|
10
|
-
//# sourceMappingURL=set-pathname.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-pathname.js","sourceRoot":"","sources":["../../src/set-pathname.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,kCAMC"}
|
package/lib/es2018/set-port.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setPort(url: string | URL, port: number): URL;
|
package/lib/es2018/set-port.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPort = void 0;
|
|
4
|
-
function setPort(url, port) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.port = port.toString();
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setPort = setPort;
|
|
10
|
-
//# sourceMappingURL=set-port.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-port.js","sourceRoot":"","sources":["../../src/set-port.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,GAAiB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IAE7B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,0BAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setProtocol(url: string | URL, protocol: string): URL;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setProtocol = void 0;
|
|
4
|
-
function setProtocol(url, protocol) {
|
|
5
|
-
const oldURL = new URL(url);
|
|
6
|
-
const newURL = new URL(oldURL.href.replace(/^(\S+:)\/\//, protocol.endsWith(':')
|
|
7
|
-
? protocol
|
|
8
|
-
: `${protocol}://`));
|
|
9
|
-
return newURL;
|
|
10
|
-
}
|
|
11
|
-
exports.setProtocol = setProtocol;
|
|
12
|
-
//# sourceMappingURL=set-protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-protocol.js","sourceRoot":"","sources":["../../src/set-protocol.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAG3B,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,MAAM,CAAC,IAAI,CAAC,OAAO,CACjB,aAAa,EACb,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QACtB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,GAAG,QAAQ,KAAK,CACnB,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAdD,kCAcC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setSearchParam(url: string | URL, name: string, value: string | number): URL;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSearchParam = void 0;
|
|
4
|
-
function setSearchParam(url, name, value) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
7
|
-
newSearchParams.set(name, value.toString());
|
|
8
|
-
newURL.search = newSearchParams.toString();
|
|
9
|
-
return newURL;
|
|
10
|
-
}
|
|
11
|
-
exports.setSearchParam = setSearchParam;
|
|
12
|
-
//# sourceMappingURL=set-search-param.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-search-param.js","sourceRoot":"","sources":["../../src/set-search-param.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,GAAiB,EAAE,IAAY,EAAE,KAAsB;IACpF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC3C,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC;AARD,wCAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setSearchParams(url: string | URL, searchParams: Record<string, string | number>): URL;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSearchParams = void 0;
|
|
4
|
-
function setSearchParams(url, searchParams) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
const newSearchParams = new URLSearchParams(newURL.searchParams);
|
|
7
|
-
for (const [name, value] of Object.entries(searchParams)) {
|
|
8
|
-
newSearchParams.set(name, value.toString());
|
|
9
|
-
}
|
|
10
|
-
newURL.search = newSearchParams.toString();
|
|
11
|
-
return newURL;
|
|
12
|
-
}
|
|
13
|
-
exports.setSearchParams = setSearchParams;
|
|
14
|
-
//# sourceMappingURL=set-search-params.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-search-params.js","sourceRoot":"","sources":["../../src/set-search-params.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAC7B,GAAiB,EACjB,YAA6C;IAE7C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAChE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACxD,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;KAC5C;IACD,MAAM,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IAE1C,OAAO,MAAM,CAAA;AACf,CAAC;AAbD,0CAaC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setSearch(url: string | URL, search: string): URL;
|
package/lib/es2018/set-search.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSearch = void 0;
|
|
4
|
-
function setSearch(url, search) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.search = search;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setSearch = setSearch;
|
|
10
|
-
//# sourceMappingURL=set-search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-search.js","sourceRoot":"","sources":["../../src/set-search.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS,CAAC,GAAiB,EAAE,MAAc;IACzD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;IAEtB,OAAO,MAAM,CAAA;AACf,CAAC;AAND,8BAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setUsername(url: string | URL, username: string): URL;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setUsername = void 0;
|
|
4
|
-
function setUsername(url, username) {
|
|
5
|
-
const newURL = new URL(url);
|
|
6
|
-
newURL.username = username;
|
|
7
|
-
return newURL;
|
|
8
|
-
}
|
|
9
|
-
exports.setUsername = setUsername;
|
|
10
|
-
//# sourceMappingURL=set-username.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-username.js","sourceRoot":"","sources":["../../src/set-username.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAiB,EAAE,QAAgB;IAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE1B,OAAO,MAAM,CAAA;AACf,CAAC;AAND,kCAMC"}
|