cloudimage-responsive-utils
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
@@ -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, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80818
1965