Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudimage-responsive-utils

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudimage-responsive-utils - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.0.0-beta.3

26

dist/utils/process-react-node.js

@@ -40,3 +40,4 @@ "use strict";

presets = config.presets,
minLowQualityWidth = config.minLowQualityWidth;
minLowQualityWidth = config.minLowQualityWidth,
devicePixelRatioList = config.devicePixelRatioList;
if (!imgNodeSRC) return;

@@ -64,7 +65,19 @@

var preview = lowQualityPreview && (0, _.isLowQualityPreview)(adaptive, width, svg, minLowQualityWidth);
var cloudimgURL = !adaptive && svg ? src : (0, _.generateURL)({
src: src,
params: params,
config: config,
containerProps: containerProps
var generateURLbyDPR = function generateURLbyDPR(devicePixelRatio) {
return !adaptive && svg ? src : (0, _.generateURL)({
src: src,
params: params,
config: config,
containerProps: containerProps,
devicePixelRatio: devicePixelRatio
});
};
var cloudimgURL = generateURLbyDPR();
var cloudimgSRCSET = devicePixelRatioList.map(function (dpr) {
return {
dpr: dpr.toString(),
url: generateURLbyDPR(dpr)
};
});

@@ -84,2 +97,3 @@

previewCloudimgURL: previewCloudimgURL,
cloudimgSRCSET: cloudimgSRCSET,
processed: true,

@@ -86,0 +100,0 @@ preview: preview

{
"name": "cloudimage-responsive-utils",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "cloudimage responsive utils",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -21,3 +21,3 @@ import {

const { config } = props;
const { baseURL, presets, minLowQualityWidth } = config;
const { baseURL, presets, minLowQualityWidth, devicePixelRatioList } = config;

@@ -38,3 +38,8 @@ if (!imgNodeSRC) return;

const preview = lowQualityPreview && isLowQualityPreview(adaptive, width, svg, minLowQualityWidth);
const cloudimgURL = !adaptive && svg ? src : generateURL({ src, params, config, containerProps });
const generateURLbyDPR = devicePixelRatio =>
!adaptive && svg ?
src :
generateURL({ src, params, config, containerProps, devicePixelRatio });
const cloudimgURL = generateURLbyDPR();
const cloudimgSRCSET = devicePixelRatioList.map(dpr => ({ dpr: dpr.toString(), url: generateURLbyDPR(dpr) }));

@@ -48,2 +53,3 @@ if (preview) {

previewCloudimgURL,
cloudimgSRCSET,
processed: true,

@@ -50,0 +56,0 @@ preview,

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc