@lijuhong1981/jsurl 1.0.10 → 1.0.11

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/index.js CHANGED
@@ -11,7 +11,7 @@ import isHttpProtocol from "./src/isHttpProtocol.js";
11
11
  import splitPath from "./src/splitPath.js";
12
12
  import splitUrl from "./src/splitUrl.js";
13
13
  import parsePath from "./src/parsePath.js";
14
- import parseQuery from "./src/parseQuery.js";
14
+ import parseQueryParams from "./src/parseQueryParams.js";
15
15
  import parseUrl from "./src/parseUrl.js";
16
16
 
17
17
  export {
@@ -28,6 +28,6 @@ export {
28
28
  splitPath,
29
29
  splitUrl,
30
30
  parsePath,
31
- parseQuery,
31
+ parseQueryParams,
32
32
  parseUrl,
33
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lijuhong1981/jsurl",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "> TODO: description",
5
5
  "author": "lijuhong1981 <lijuhong@hotmail.com>",
6
6
  "homepage": "https://github.com/lijuhong1981/jslibs#readme",
@@ -18,5 +18,5 @@
18
18
  "bugs": {
19
19
  "url": "https://github.com/lijuhong1981/jslibs/issues"
20
20
  },
21
- "gitHead": "75538582d4f88fbef4e366404a96264c40bb05d8"
21
+ "gitHead": "28808200a5bfcfc5c70fb5be3d44f6f193390c68"
22
22
  }
@@ -6,11 +6,11 @@ const queryPattern = /(?:^|&)([^&=]*)=?([^&]*)/g;
6
6
  * @param {object} result
7
7
  * @returns {object}
8
8
  */
9
- function parseQuery(urlQuery, result = {}) {
9
+ function parseQueryParams(urlQuery, result = {}) {
10
10
  urlQuery.replace(queryPattern, function (match, key, value) {
11
11
  if (key)
12
12
  result[key] = value;
13
13
  });
14
14
  };
15
15
 
16
- export default parseQuery;
16
+ export default parseQueryParams;
package/src/parseUrl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import splitUrl from "./splitUrl.js";
2
- import parseQuery from "./parseQuery.js";
2
+ import parseQueryParams from "./parseQueryParams.js";
3
3
 
4
4
  const names = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"];
5
5
 
@@ -37,7 +37,7 @@ function parseUrl(url, result = {}) {
37
37
  }
38
38
  result.queryParams = {};
39
39
  if (result.query)
40
- parseQuery(result.query, result.queryParams);
40
+ parseQueryParams(result.query, result.queryParams);
41
41
  return result;
42
42
  };
43
43