mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 21:07:48 +00:00
[cli][client][tests] update to node14-compatible target (drop support for node12) (#7865)
Node 12 is EOL and we're starting to reference packages that don't install on node lower than 14, such as nuxt@3 and remix. Let's update to 14 for now. --- Reimplements: https://github.com/vercel/vercel/pull/7819
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
const fetch = require('node-fetch');
|
||||
const retryBailByDefault = require('./retry-bail-by-default.js');
|
||||
|
||||
async function fetchRetry(...args) {
|
||||
const ABSOLUTE_URL_PATTERN = /^https?:\/\//i;
|
||||
|
||||
async function fetchRetry(url, ...rest) {
|
||||
if (!ABSOLUTE_URL_PATTERN.test(url)) {
|
||||
throw new Error(`fetch url must be absolute: "${url}"`);
|
||||
}
|
||||
|
||||
return await retryBailByDefault(
|
||||
async canRetry => {
|
||||
try {
|
||||
return await fetch(...args);
|
||||
return await fetch(url, ...rest);
|
||||
} catch (error) {
|
||||
if (error.type === 'request-timeout') {
|
||||
// FetchError: network timeout at: ...
|
||||
|
||||
Reference in New Issue
Block a user