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

gatsby-plugin-storyblok-image

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-storyblok-image - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

2

dist/defaults.js

@@ -10,4 +10,4 @@ "use strict";

breakpoints: [750, 1080, 1366, 1920],
fit: 'cover',
fitIn: false,
fitInColor: 'transparent'
};

@@ -8,3 +8,3 @@ export interface GetGatsbyImageOptions {

breakpoints?: number[];
fit?: 'cover' | 'contain';
fitIn?: boolean;
fitInColor?: string;

@@ -21,3 +21,3 @@ backgroundColor?: string;

fitInColor: string;
fit: 'cover' | 'contain';
fitIn: boolean;
}
import { MergedGetGatsbyImageOptions } from '../typings/module';
interface Image extends Partial<Pick<MergedGetGatsbyImageOptions, 'width' | 'height' | 'smartCrop' | 'quality' | 'fit' | 'fitInColor'>> {
interface Image extends Partial<Pick<MergedGetGatsbyImageOptions, 'width' | 'height' | 'smartCrop' | 'quality' | 'fitIn' | 'fitInColor'>> {
}
export default function buildImageUrl(originalPath: string, image: Image): string;
export declare function buildLowFiUrl(originalPath: string, opt?: Pick<Image, 'fit'>): string;
export declare function buildLowFiUrl(originalPath: string, opt?: Pick<Image, 'fitIn'>): string;
export {};

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

function buildImageUrl(originalPath, image) {
const { width, height, smartCrop, quality, fit, fitInColor } = image;
const { width, height, smartCrop, quality, fitIn, fitInColor } = image;
// const [, extension] = originalPath.split('.')

@@ -22,2 +22,5 @@ // base url

url += originalPath + '/m';
if (fitIn) {
url += '/fit-in';
}
if (width || height) {

@@ -29,7 +32,6 @@ url += `/${width || 0}x${height || 0}`;

}
const fitToContain = fit === 'contain';
const filters = [
quality && `quality(${quality})`,
// format && format !== extension && `format(${format})`,
fitToContain && `fill(${(fitInColor || TRANSPARENT).replace('#', '')})`
fitIn && `fill(${(fitInColor || TRANSPARENT).replace('#', '')})`
].filter(Boolean);

@@ -50,5 +52,5 @@ if (filters.length > 0) {

quality: 10,
fit: opt === null || opt === void 0 ? void 0 : opt.fit
fitIn: opt === null || opt === void 0 ? void 0 : opt.fitIn
});
}
exports.buildLowFiUrl = buildLowFiUrl;
{
"name": "gatsby-plugin-storyblok-image",
"version": "2.0.4",
"version": "2.0.5",
"description": "Adds gatsby-plugin-image to Gatsby & Storyblok as a content source.",

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

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