New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hashicorp/react-image

Package Overview
Dependencies
Maintainers
16
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashicorp/react-image - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

20

dist/index.js

@@ -78,12 +78,13 @@ 'use strict';

// scrape format from file extension if not provided
if (!format) format = url.match(/\.(\w+)$/)[1]; // set default imgix options, merge user preferences with priority
var parsedFormat = parseFormat(format, url);
var formatOption = parsedFormat ? {
fm: parsedFormat
} : {}; // set default imgix options, merge user preferences with priority
var opts = assign({
fm: format,
fit: aspectRatio ? 'crop' : 'max',
q: 80
}, imgixOptions); // if it's an SVG, we don't need the picture element, so return
}, formatOption, imgixOptions); // if it's an SVG, we don't need the picture element, so return
if (format === 'svg') return React.createElement("img", _extends({
if (parsedFormat === 'svg') return React.createElement("img", _extends({
"data-testid": "image-root",

@@ -119,2 +120,11 @@ src: url,

function parseFormat(format, url) {
// Use the format prop if it was provided
if (format) return format; // Fallback to parsing it from the extension
var extensionMatch = url.match(/\.(\w+)$/);
var hasExtension = !!extensionMatch && !!extensionMatch[1];
return hasExtension ? extensionMatch[1] : false;
}
function formatSteps(steps, opts, aspectRatio, src) {

@@ -121,0 +131,0 @@ return steps.map(function (s) {

{
"name": "@hashicorp/react-image",
"description": "super optimized image element, pulls from dato and formats for 7 screen sizes in two formats. Skips optimization for SVGs.",
"version": "2.0.0",
"version": "2.0.1",
"author": "Hashicorp - Jeff Escalante",

@@ -21,3 +21,3 @@ "dependencies": {

},
"gitHead": "2820c17206084ce62de83b43a65d4f407418e519"
"gitHead": "661e01731e31241b9b32862dad4eb376cabefe2a"
}
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