Socket
Socket
Sign inDemoInstall

@lighthouse/common

Package Overview
Dependencies
122
Maintainers
15
Versions
461
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.27.5-canary.118.1527 to 4.27.5-canary.118.1531

11

dist/helpers/fetch-image/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc