@hashicorp/hashi-image
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -7,2 +7,3 @@ 'use strict'; | ||
var queryString = _interopDefault(require('query-string')); | ||
var assign = _interopDefault(require('object-assign')); | ||
@@ -24,3 +25,3 @@ function Image(_ref) { | ||
// set default params, merge user preferences with priority | ||
var opts = Object.assign({ | ||
var opts = assign({ | ||
fm: src.match(/\.(\w+)$/)[1], | ||
@@ -57,3 +58,3 @@ fit: aspect_ratio ? 'crop' : 'max', | ||
return steps.map(function (s) { | ||
var opt = Object.assign({}, opts, { w: s }, overrides); | ||
var opt = assign({}, opts, { w: s }, overrides); | ||
if (aspect_ratio) opt.h = aspect_ratio[1] / aspect_ratio[0] * s; | ||
@@ -60,0 +61,0 @@ return src + '?' + queryString.stringify(opt) + ' ' + s + 'w'; |
{ | ||
"name": "@hashicorp/hashi-image", | ||
"description": "super optimized image element, pulls from dato and formats for 7 screen sizes in two formats. Skips optimization for SVGs.", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "dist", | ||
"peerDependencies": { | ||
"object-assign": "^4.1.1", | ||
"preact": "^8.2.6" | ||
@@ -8,0 +9,0 @@ }, |
3097
54
2