studiokit-scaffolding-js 4.7.1-alpha.6 → 4.7.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.
Files changed (2) hide show
  1. package/lib/utils/url.js +5 -4
  2. package/package.json +3 -3
package/lib/utils/url.js CHANGED
@@ -75,7 +75,8 @@ function isUrlValid(url) {
75
75
  return /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=]+$/.test(url);
76
76
  }
77
77
  exports.isUrlValid = isUrlValid;
78
- var RETRY_LIMIT = 5;
78
+ /** The total number of tries for `fetchText`, including the initial request. */
79
+ var TRY_LIMIT = 5;
79
80
  function wait(time) {
80
81
  return new Promise(function (resolve) {
81
82
  setTimeout(resolve, time);
@@ -104,16 +105,16 @@ function fetchText(url, options) {
104
105
  case 5:
105
106
  error_1 = _a.sent();
106
107
  logger_1.getLogger().error("Failed to fetch " + url + ". attempt: " + tryCount + ", error: " + error_1);
107
- if (!(tryCount < RETRY_LIMIT)) return [3 /*break*/, 7];
108
+ if (!(tryCount < TRY_LIMIT)) return [3 /*break*/, 7];
108
109
  return [4 /*yield*/, wait(Math.pow(2, (tryCount - 1)) * 100)]; // 100, 200, 400, 800
109
110
  case 6:
110
111
  _a.sent(); // 100, 200, 400, 800
111
112
  _a.label = 7;
112
113
  case 7: return [3 /*break*/, 8];
113
114
  case 8:
114
- if (tryCount < RETRY_LIMIT) return [3 /*break*/, 1];
115
+ if (tryCount < TRY_LIMIT) return [3 /*break*/, 1];
115
116
  _a.label = 9;
116
- case 9: throw new Error("Failed to fetch " + url + " after " + RETRY_LIMIT + " attempts.");
117
+ case 9: throw new Error("Failed to fetch " + url + " after " + TRY_LIMIT + " attempts.");
117
118
  }
118
119
  });
119
120
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "studiokit-scaffolding-js",
3
- "version": "4.7.1-alpha.6",
3
+ "version": "4.7.1",
4
4
  "description": "Common scaffolding for Studio apps at Purdue",
5
5
  "repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
6
6
  "license": "MIT",
@@ -92,7 +92,7 @@
92
92
  "lodash": "^4.17.20",
93
93
  "mixin-deep": "^1.3.2",
94
94
  "set-value": "^2.0.1",
95
- "studiokit-net-js": "^4.1.2"
95
+ "studiokit-net-js": "^4.1.4"
96
96
  },
97
97
  "dependencies": {
98
98
  "@material-ui/core": "^4.11.3",
@@ -148,7 +148,7 @@
148
148
  "redux-saga": "^1.1.3",
149
149
  "studiokit-auth-js": "^3.0.2",
150
150
  "studiokit-caliper-js": "^1.0.23",
151
- "studiokit-net-js": "^4.1.2",
151
+ "studiokit-net-js": "^4.1.4",
152
152
  "tachyons": "^4.12.0",
153
153
  "tslib": "^2.1.0",
154
154
  "uuid": "^8.3.2"