@lighthouse/common
Advanced tools
Comparing version 4.27.5-canary.118.1527 to 4.27.5-canary.118.1531
@@ -21,2 +21,4 @@ "use strict"; | ||
var _images = require("../../images"); | ||
// NOTE use the native fetch if it's available in the browser, because the | ||
@@ -43,3 +45,3 @@ // ponyfill (which actually uses the github polyfill) does not support all the | ||
function fetchImage(url, options = {}, retriesLeft = 2) { | ||
function fetchImage(url, options = {}) { | ||
const encodedUrl = encodeURI(url); | ||
@@ -93,8 +95,3 @@ const fetchOptions = { ...defaultOptions, | ||
console.error(error); | ||
if (retriesLeft > 0) { | ||
return fetchImage(_constants.DEFAULT_IMAGE_URL, defaultOptions, retriesLeft - 1); | ||
} | ||
throw error; | ||
return _images.imageNotFound; | ||
}); | ||
@@ -101,0 +98,0 @@ } |
@@ -11,3 +11,4 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
import Promise from 'bluebird'; | ||
import { DEFAULT_IMAGE_URL, LIGHTHOUSE_LOGO_URL } from '../../constants'; // NOTE use the native fetch if it's available in the browser, because the | ||
import { LIGHTHOUSE_LOGO_URL } from '../../constants'; | ||
import { imageNotFound } from '../../images'; // NOTE use the native fetch if it's available in the browser, because the | ||
// ponyfill (which actually uses the github polyfill) does not support all the | ||
@@ -35,3 +36,2 @@ // same options as native fetch | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var retriesLeft = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2; | ||
var encodedUrl = encodeURI(url); | ||
@@ -85,8 +85,3 @@ | ||
console.error(error); | ||
if (retriesLeft > 0) { | ||
return fetchImage(DEFAULT_IMAGE_URL, defaultOptions, retriesLeft - 1); | ||
} | ||
throw error; | ||
return imageNotFound; | ||
}); | ||
@@ -93,0 +88,0 @@ } |
{ | ||
"name": "@lighthouse/common", | ||
"version": "4.27.5-canary.118.1527", | ||
"version": "4.27.5-canary.118.1531", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
1245054
11986