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

cloudimage-responsive-utils

Package Overview
Dependencies
Maintainers
2
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.3.1-beta.0 to 2.3.1-beta.1

5

dist/utils/get-height.js

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

ignoreStyleImgSize = config.ignoreStyleImgSize,
imageSizeAttributes = config.imageSizeAttributes;
imageSizeAttributes = config.imageSizeAttributes,
detectDimension = config.detectDimension;
var ignoreNodeImgSize = typeof _ignoreNodeImgSize !== 'undefined' ? _ignoreNodeImgSize : imageSizeAttributes !== 'use';

@@ -74,3 +75,3 @@ var crop = (0, _isCrop.isCrop)(params.func || config.params.func);

if (!crop) {
if (!crop && detectDimension !== 'height') {
return null;

@@ -77,0 +78,0 @@ }

10

dist/utils/get-parent-container-size.js

@@ -16,3 +16,3 @@ "use strict";

parentNode = parentNode && parentNode.parentNode;
size = typeof parentNode.getBoundingClientRect === 'function' ? parentNode.getBoundingClientRect()[type] : window.innerWidth;
size = typeof parentNode.getBoundingClientRect === 'function' ? parentNode.getBoundingClientRect()[type] : null;
maxCount = maxCount + 1;

@@ -25,3 +25,3 @@ } while (parentNode && !size && maxCount > 5);

if (!size) {
size = window.innerWidth;
size = getDefaultDimension(type);
}

@@ -32,2 +32,6 @@

exports.getParentContainerSize = getParentContainerSize;
exports.getParentContainerSize = getParentContainerSize;
function getDefaultDimension(type) {
return type === 'width' ? window.innerWidth : window.innerHeight;
}
{
"name": "cloudimage-responsive-utils",
"version": "2.3.1-beta.0",
"version": "2.3.1-beta.1",
"description": "cloudimage responsive utils",

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

@@ -24,3 +24,3 @@ import { convertToPX } from '../utils/convert-to-px';

const { imgNode = null, config = {}, imgNodeHeight = null, params = {}, size, width } = props;
const { ignoreNodeImgSize: _ignoreNodeImgSize, ignoreStyleImgSize, imageSizeAttributes } = config;
const { ignoreNodeImgSize: _ignoreNodeImgSize, ignoreStyleImgSize, imageSizeAttributes, detectDimension } = config;
const ignoreNodeImgSize = typeof _ignoreNodeImgSize !== 'undefined' ?

@@ -56,3 +56,3 @@ _ignoreNodeImgSize : imageSizeAttributes !== 'use';

if (!crop) {
if (!crop && detectDimension !== 'height') {
return null;

@@ -59,0 +59,0 @@ }

@@ -8,3 +8,3 @@ export const getParentContainerSize = (img, type = 'width') => {

parentNode = parentNode && parentNode.parentNode;
size = typeof parentNode.getBoundingClientRect === 'function' ? parentNode.getBoundingClientRect()[type] : window.innerWidth;
size = typeof parentNode.getBoundingClientRect === 'function' ? parentNode.getBoundingClientRect()[type] : null
maxCount = maxCount + 1;

@@ -17,3 +17,3 @@ } while (parentNode && !size && maxCount > 5)

if (!size) {
size = window.innerWidth;
size = getDefaultDimension(type);
}

@@ -23,1 +23,5 @@

};
function getDefaultDimension(type) {
return type === 'width' ? window.innerWidth : window.innerHeight;
}
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