@pagedip/util-npm
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -87,12 +87,29 @@ /* eslint-disable */"use strict"; | ||
var req = registryRequest(registry, "GET", name.replace("/", "%2F")); | ||
var attempts = 0; | ||
var attempt = function () { | ||
var _ref8 = _asyncToGenerator(function* () { | ||
try { | ||
attempts++; | ||
try { | ||
var _ref8 = yield req, | ||
body = _ref8.body; | ||
var req = registryRequest(registry, "GET", name.replace("/", "%2F")); | ||
return body; | ||
} catch (e) { | ||
if (!e.response || e.response.status !== 404) throw e; | ||
} | ||
req.timeout({ | ||
response: 3000, | ||
deadline: 30 * 1000 | ||
}); | ||
return (yield req).body; | ||
} catch (e) { | ||
if (e.response && e.response.status === 404) return; | ||
if (attempts >= 5) throw e; | ||
return yield attempt(); | ||
} | ||
}); | ||
return function attempt() { | ||
return _ref8.apply(this, arguments); | ||
}; | ||
}(); | ||
return attempt(); | ||
}); | ||
@@ -236,2 +253,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJhcmdzIiwib3B0cyIsIkFycmF5IiwiaXNBcnJheSIsImJ1ZmZlciIsIm5wbUJpblBhdGgiLCJnbG9iYWxOcG1CaW4iLCJvcHRpb25zIiwiZnVsbEFyZ3MiLCJQcm9taXNlIiwicmVzb2x2ZSIsInJlamVjdCIsImNwIiwic3RkaW8iLCJvbiIsImNvZGUiLCJFcnJvciIsIm5wbUNvbW1hbmQiLCJnbG9iYWxOcG1Db25maWciLCJsb2FkZWQiLCJyIiwicmVzb2x2IiwibG9hZCIsImVyciIsImNvbmYiLCJwcmVmaXgiLCJldGMiLCJzIiwiZnMiLCJzdGF0IiwiaXNEaXJlY3RvcnkiLCJybWRpciIsImUiLCJsb2FkTnBtQ29uZmlnIiwicmVnaXN0cnkiLCJuYW1lIiwicmVxIiwicmVnaXN0cnlSZXF1ZXN0Iiwic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V0Y2hSZWxlYXNlKHJlZ2lzdHJ5LCBuYW1lLCB0YWdzKSB7XG4gIGNvbnN0IGluZm8gPSBhd2FpdCBmZXRjaFBhY2thZ2VJbmZvKHJlZ2lzdHJ5LCBuYW1lKTtcbiAgcmV0dXJuIGdldFJlbGVhc2UoaW5mbywgdGFncyk7XG59XG4iXX0= |
{ | ||
"name": "@pagedip/util-npm", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"public": true, | ||
@@ -31,3 +31,3 @@ "author": "Tyler Johnson <tyler@beneaththeink.com>", | ||
], | ||
"gitHead": "6366495a48f008a7ab403fa822bca34af305b826" | ||
"gitHead": "24fe1d0ab40e0047b69fb4c0dd87b9754dbc4690" | ||
} |
23092
193