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.0-beta.2 to 2.3.0

24

CHANGELOG.MD

@@ -29,2 +29,26 @@ # Changelog

# 2.3.0 - 2021-06-16
### Deprecated
Property **ignoreNodeImgSize** is deprecated. Use **imageSizeAttributes: 'ignore'** instead
### Added
- new property:
##### **imageSizeAttributes**
###### Type: **String** | possible values: 'use', 'ignore', 'take-ratio' | Default: **'use'**
If width and height attributes are set:
**use** - width & height attributes values will be used to calculate image size (according to user's DPR) and **ratio**.
**take-ratio** - width & height attributes values will be used only to calculate **ratio**.
**ignore** - width & height attributes will be ignored.
If width and height attributes are NOT set, image container size will be detected to calculate result image size (according to user's DPR)
*Note*: If only width or height attributes is set, ratio is going to be taken from ci-ratio image attribute
# 2.2.0 - 2021-06-16

@@ -31,0 +55,0 @@ ### Added

3

dist/utils/get-ratio.js

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

imgNodeHeight = _ref.imgNodeHeight;
var saveNodeImgRatio = config.saveNodeImgRatio,
imageSizeAttributes = config.imageSizeAttributes;
var imageSizeAttributes = config.imageSizeAttributes;
var ignoreNodeRatio = imageSizeAttributes === 'ignore';

@@ -20,0 +19,0 @@

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

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

export const getRatio = ({ imgNodeRatio, width, height, size, config, imgNodeWidth, imgNodeHeight }) => {
const { saveNodeImgRatio, imageSizeAttributes } = config;
const { imageSizeAttributes } = config;
const ignoreNodeRatio = imageSizeAttributes === 'ignore';

@@ -4,0 +4,0 @@

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