gatsby-plugin-storyblok-image
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -110,3 +110,3 @@ "use strict"; | ||
sources: [], | ||
fallback: options.fallback === false ? null : (0, buildImageUrl_1.buildLowFiUrl)(originalPath, { width, height }) | ||
fallback: options.fallback === false ? null : (0, buildImageUrl_1.buildLowFiUrl)(originalPath, options) | ||
}, | ||
@@ -113,0 +113,0 @@ backgroundColor: options.backgroundColor || 'transparent', |
@@ -5,3 +5,3 @@ import { MergedGetGatsbyImageOptions } from '../typings/module'; | ||
export default function buildImageUrl(originalPath: string, image: Image): string; | ||
export declare function buildLowFiUrl(originalPath: string, opt?: Pick<Image, 'fitIn' | 'height' | 'width'>): string; | ||
export declare function buildLowFiUrl(originalPath: string, opt?: Image): string; | ||
export {}; |
@@ -43,7 +43,7 @@ "use strict"; | ||
exports.default = buildImageUrl; | ||
function buildLowFiUrl(originalPath, opt) { | ||
function buildLowFiUrl(originalPath, opt = {}) { | ||
const width = 20; | ||
let height = undefined; | ||
// Compat case when croping with different aspect ratio | ||
if ((opt === null || opt === void 0 ? void 0 : opt.height) && (opt === null || opt === void 0 ? void 0 : opt.width)) { | ||
if (opt.height && opt.width) { | ||
height = (opt.height / opt.width) * width; | ||
@@ -55,5 +55,5 @@ } | ||
quality: 10, | ||
fitIn: opt === null || opt === void 0 ? void 0 : opt.fitIn | ||
fitIn: opt.fitIn | ||
}); | ||
} | ||
exports.buildLowFiUrl = buildLowFiUrl; |
{ | ||
"name": "gatsby-plugin-storyblok-image", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "Adds gatsby-plugin-image to Gatsby & Storyblok as a content source.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
17102