url-operator 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -73,3 +73,13 @@ function appendSearchParam(
73
73
  ```ts
74
74
  function setHash(url: string | URL, hash: string): URL
75
75
  ```
76
+
77
+ ### encode
78
+ ```ts
79
+ function encode(url: string | URL): string
80
+ ```
81
+
82
+ ### decode
83
+ ```ts
84
+ function decode(url: string | URL): string
85
+ ```
@@ -0,0 +1 @@
1
+ export declare function decode(url: string | URL): string;
package/lib/decode.js ADDED
@@ -0,0 +1,5 @@
1
+ export function decode(url) {
2
+ const newURL = new URL(url);
3
+ return decodeURI(newURL.href);
4
+ }
5
+ //# sourceMappingURL=decode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode.js","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,GAAiB;IACtC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function encode(url: string | URL): string;
package/lib/encode.js ADDED
@@ -0,0 +1,5 @@
1
+ export function encode(url) {
2
+ const newURL = new URL(url);
3
+ return newURL.href;
4
+ }
5
+ //# sourceMappingURL=encode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encode.js","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,GAAiB;IACtC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAE3B,OAAO,MAAM,CAAC,IAAI,CAAA;AACpB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -10,3 +10,5 @@ export * from './set-search-param.js';
10
10
  export * from './set-search-params.js';
11
11
  export * from './append-search-param.js';
12
12
  export * from './set-hash.js';
13
+ export * from './encode.js';
14
+ export * from './decode.js';
package/lib/index.js CHANGED
@@ -10,4 +10,6 @@ export * from './set-search-param.js';
10
10
  export * from './set-search-params.js';
11
11
  export * from './append-search-param.js';
12
12
  export * from './set-hash.js';
13
+ export * from './encode.js';
14
+ export * from './decode.js';
13
15
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +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"}
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;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "url-operator",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "files": [