@common.js/query-string 8.2.0 → 9.0.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/base.js +6 -8
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  The [query-string](https://www.npmjs.com/package/query-string) package exported as CommonJS modules.
4
4
 
5
- Exported from [query-string@8.2.0](https://www.npmjs.com/package/query-string/v/8.2.0) using https://github.com/etienne-martin/common.js.
5
+ Exported from [query-string@9.0.0](https://www.npmjs.com/package/query-string/v/9.0.0) using https://github.com/etienne-martin/common.js.
package/base.js CHANGED
@@ -130,7 +130,7 @@ var isNullOrUndefined = function(value) {
130
130
  };
131
131
  // eslint-disable-next-line unicorn/prefer-code-point
132
132
  var strictUriEncode = function(string) {
133
- return encodeURIComponent(string).replace(/[!'()*]/g, function(x) {
133
+ return encodeURIComponent(string).replaceAll(/[!'()*]/g, function(x) {
134
134
  return "%".concat(x.charCodeAt(0).toString(16).toUpperCase());
135
135
  });
136
136
  };
@@ -221,7 +221,7 @@ function encoderForArrayFormat(options) {
221
221
  case "separator":
222
222
  case "bracket-separator":
223
223
  {
224
- var keyValueSep = options.arrayFormat === "bracket-separator" ? "[]=" : "=";
224
+ var keyValueSeparator = options.arrayFormat === "bracket-separator" ? "[]=" : "=";
225
225
  return function(key) {
226
226
  return function(result, value) {
227
227
  if (value === undefined || options.skipNull && value === null || options.skipEmptyString && value === "") {
@@ -233,7 +233,7 @@ function encoderForArrayFormat(options) {
233
233
  return [
234
234
  [
235
235
  encode(key, options),
236
- keyValueSep,
236
+ keyValueSeparator,
237
237
  encode(value, options)
238
238
  ].join("")
239
239
  ];
@@ -465,7 +465,7 @@ function parse(query, options) {
465
465
  if (parameter === "") {
466
466
  continue;
467
467
  }
468
- var parameter_ = options.decode ? parameter.replace(/\+/g, " ") : parameter;
468
+ var parameter_ = options.decode ? parameter.replaceAll("+", " ") : parameter;
469
469
  var ref = _slicedToArray((0, _splitOnFirst.default)(parameter_, "="), 2), key = ref[0], value = ref[1];
470
470
  if (key === undefined) {
471
471
  key = parameter_;
@@ -636,11 +636,9 @@ function stringifyUrl(object, options) {
636
636
  sort: false
637
637
  }), object.query);
638
638
  var queryString = stringify(query, options);
639
- if (queryString) {
640
- queryString = "?".concat(queryString);
641
- }
639
+ queryString && (queryString = "?".concat(queryString));
642
640
  var hash = getHash(object.url);
643
- if (object.fragmentIdentifier) {
641
+ if (typeof object.fragmentIdentifier === "string") {
644
642
  var urlObjectForFragmentEncode = new URL(url);
645
643
  urlObjectForFragmentEncode.hash = object.fragmentIdentifier;
646
644
  hash = options[encodeFragmentIdentifier] ? urlObjectForFragmentEncode.hash : "#".concat(object.fragmentIdentifier);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common.js/query-string",
3
- "version": "8.2.0",
3
+ "version": "9.0.0",
4
4
  "description": "query-string package exported as CommonJS modules",
5
5
  "license": "MIT",
6
6
  "repository": "etienne-martin/common.js",
@@ -8,7 +8,7 @@
8
8
  "type": "commonjs",
9
9
  "sideEffects": false,
10
10
  "engines": {
11
- "node": ">=14.16"
11
+ "node": ">=18"
12
12
  },
13
13
  "scripts": {
14
14
  "benchmark": "node benchmark.js",
@@ -26,12 +26,12 @@
26
26
  "@common.js/split-on-first": "^3.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "ava": "^5.1.0",
29
+ "ava": "^6.1.1",
30
30
  "benchmark": "^2.1.4",
31
- "deep-equal": "^2.1.0",
32
- "fast-check": "^3.4.0",
33
- "tsd": "^0.25.0",
34
- "xo": "^0.54.2"
31
+ "deep-equal": "^2.2.3",
32
+ "fast-check": "^3.15.1",
33
+ "tsd": "^0.30.7",
34
+ "xo": "^0.57.0"
35
35
  },
36
36
  "tsd": {
37
37
  "compilerOptions": {