@dereekb/util 13.15.0 → 13.16.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.
@@ -9415,7 +9415,7 @@ function collectRuleCompanions(parsed) {
9415
9415
  * @param name - The original SCREAMING_CASE identifier.
9416
9416
  * @returns The suggested identifier with `DEFAULT_` prefixed.
9417
9417
  */ function suggestedName(name) {
9418
- var stripped = name.replace(/_DEFAULT(?=_|$)/g, '');
9418
+ var stripped = name.replaceAll(/_DEFAULT(?=_|$)/g, '');
9419
9419
  return "DEFAULT_".concat(stripped);
9420
9420
  }
9421
9421
  /**
@@ -9413,7 +9413,7 @@ function collectRuleCompanions(parsed) {
9413
9413
  * @param name - The original SCREAMING_CASE identifier.
9414
9414
  * @returns The suggested identifier with `DEFAULT_` prefixed.
9415
9415
  */ function suggestedName(name) {
9416
- var stripped = name.replace(/_DEFAULT(?=_|$)/g, '');
9416
+ var stripped = name.replaceAll(/_DEFAULT(?=_|$)/g, '');
9417
9417
  return "DEFAULT_".concat(stripped);
9418
9418
  }
9419
9419
  /**
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@dereekb/util/eslint",
3
- "version": "13.15.0",
3
+ "version": "13.16.0",
4
4
  "peerDependencies": {
5
- "@dereekb/util": "13.15.0",
5
+ "@dereekb/util": "13.16.0",
6
6
  "@typescript-eslint/utils": "8.59.3"
7
7
  },
8
8
  "devDependencies": {
@@ -1079,23 +1079,15 @@ function fetchFileFromUrl(input, safe) {
1079
1079
  ];
1080
1080
  case 1:
1081
1081
  response = _state.sent();
1082
- if (!!response.ok) return [
1082
+ if (!response.ok) return [
1083
1083
  3,
1084
- 2
1084
+ 3
1085
1085
  ];
1086
- if (!safe) {
1087
- throw new Error("Failed to fetch file from ".concat(url, ": ").concat(response.status, " ").concat(response.statusText));
1088
- }
1089
- return [
1090
- 3,
1091
- 4
1092
- ];
1093
- case 2:
1094
1086
  return [
1095
1087
  4,
1096
1088
  response.arrayBuffer()
1097
1089
  ];
1098
- case 3:
1090
+ case 2:
1099
1091
  buffer = _state.sent();
1100
1092
  responseMimeType = (_ref = mimeType !== null && mimeType !== void 0 ? mimeType : response.headers.get('content-type')) !== null && _ref !== void 0 ? _ref : undefined;
1101
1093
  fileName = (_ref1 = (_input_fileName = input.fileName) !== null && _input_fileName !== void 0 ? _input_fileName : util.urlWithoutParameters(url).split('/').pop()) !== null && _ref1 !== void 0 ? _ref1 : 'file';
@@ -1105,6 +1097,14 @@ function fetchFileFromUrl(input, safe) {
1105
1097
  result = new File([
1106
1098
  buffer
1107
1099
  ], fileName, options);
1100
+ return [
1101
+ 3,
1102
+ 4
1103
+ ];
1104
+ case 3:
1105
+ if (!safe) {
1106
+ throw new Error("Failed to fetch file from ".concat(url, ": ").concat(response.status, " ").concat(response.statusText));
1107
+ }
1108
1108
  _state.label = 4;
1109
1109
  case 4:
1110
1110
  return [
@@ -2457,10 +2457,10 @@ function _unsupported_iterable_to_array(o, minLen) {
2457
2457
  var baseUrl = fetchURL(input.url);
2458
2458
  if (input.queryParams) {
2459
2459
  var searchParams = queryParamsToSearchParams(input.queryParams);
2460
- if (!util.isEmptyIterable(searchParams)) {
2461
- url = util.fixExtraQueryParameters(baseUrl + "?".concat(searchParams.toString()));
2462
- } else {
2460
+ if (util.isEmptyIterable(searchParams)) {
2463
2461
  url = baseUrl;
2462
+ } else {
2463
+ url = util.fixExtraQueryParameters(baseUrl + "?".concat(searchParams.toString()));
2464
2464
  }
2465
2465
  } else {
2466
2466
  url = baseUrl;
@@ -2726,7 +2726,7 @@ var JsonResponseParseError = /*#__PURE__*/ function(Error1) {
2726
2726
  * @param body
2727
2727
  * @returns
2728
2728
  */ function fetchJsonBodyString(body) {
2729
- return body != null ? typeof body === 'string' ? body : JSON.stringify(body) : undefined;
2729
+ return body == null ? undefined : typeof body === 'string' ? body : JSON.stringify(body);
2730
2730
  }
2731
2731
  var throwJsonResponseParseErrorFunction = function throwJsonResponseParseErrorFunction(response) {
2732
2732
  throw new JsonResponseParseError(response);
@@ -1077,23 +1077,15 @@ function fetchFileFromUrl(input, safe) {
1077
1077
  ];
1078
1078
  case 1:
1079
1079
  response = _state.sent();
1080
- if (!!response.ok) return [
1080
+ if (!response.ok) return [
1081
1081
  3,
1082
- 2
1082
+ 3
1083
1083
  ];
1084
- if (!safe) {
1085
- throw new Error("Failed to fetch file from ".concat(url, ": ").concat(response.status, " ").concat(response.statusText));
1086
- }
1087
- return [
1088
- 3,
1089
- 4
1090
- ];
1091
- case 2:
1092
1084
  return [
1093
1085
  4,
1094
1086
  response.arrayBuffer()
1095
1087
  ];
1096
- case 3:
1088
+ case 2:
1097
1089
  buffer = _state.sent();
1098
1090
  responseMimeType = (_ref = mimeType !== null && mimeType !== void 0 ? mimeType : response.headers.get('content-type')) !== null && _ref !== void 0 ? _ref : undefined;
1099
1091
  fileName = (_ref1 = (_input_fileName = input.fileName) !== null && _input_fileName !== void 0 ? _input_fileName : urlWithoutParameters(url).split('/').pop()) !== null && _ref1 !== void 0 ? _ref1 : 'file';
@@ -1103,6 +1095,14 @@ function fetchFileFromUrl(input, safe) {
1103
1095
  result = new File([
1104
1096
  buffer
1105
1097
  ], fileName, options);
1098
+ return [
1099
+ 3,
1100
+ 4
1101
+ ];
1102
+ case 3:
1103
+ if (!safe) {
1104
+ throw new Error("Failed to fetch file from ".concat(url, ": ").concat(response.status, " ").concat(response.statusText));
1105
+ }
1106
1106
  _state.label = 4;
1107
1107
  case 4:
1108
1108
  return [
@@ -2455,10 +2455,10 @@ function _unsupported_iterable_to_array(o, minLen) {
2455
2455
  var baseUrl = fetchURL(input.url);
2456
2456
  if (input.queryParams) {
2457
2457
  var searchParams = queryParamsToSearchParams(input.queryParams);
2458
- if (!isEmptyIterable(searchParams)) {
2459
- url = fixExtraQueryParameters(baseUrl + "?".concat(searchParams.toString()));
2460
- } else {
2458
+ if (isEmptyIterable(searchParams)) {
2461
2459
  url = baseUrl;
2460
+ } else {
2461
+ url = fixExtraQueryParameters(baseUrl + "?".concat(searchParams.toString()));
2462
2462
  }
2463
2463
  } else {
2464
2464
  url = baseUrl;
@@ -2724,7 +2724,7 @@ var JsonResponseParseError = /*#__PURE__*/ function(Error1) {
2724
2724
  * @param body
2725
2725
  * @returns
2726
2726
  */ function fetchJsonBodyString(body) {
2727
- return body != null ? typeof body === 'string' ? body : JSON.stringify(body) : undefined;
2727
+ return body == null ? undefined : typeof body === 'string' ? body : JSON.stringify(body);
2728
2728
  }
2729
2729
  var throwJsonResponseParseErrorFunction = function throwJsonResponseParseErrorFunction(response) {
2730
2730
  throw new JsonResponseParseError(response);
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@dereekb/util/fetch",
3
- "version": "13.15.0",
3
+ "version": "13.16.0",
4
4
  "peerDependencies": {
5
- "@dereekb/util": "13.15.0",
5
+ "@dereekb/util": "13.16.0",
6
6
  "make-error": "^1.3.6",
7
7
  "fast-content-type-parse": "^3.0.0"
8
8
  },