Socket
Socket
Sign inDemoInstall

@uxf/core

Package Overview
Dependencies
4
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.0.0-beta.22 to 10.0.0-beta.25

2

package.json
{
"name": "@uxf/core",
"version": "10.0.0-beta.22",
"version": "10.0.0-beta.25",
"description": "UXF Core",

@@ -5,0 +5,0 @@ "author": "Petr Vejvoda <vejvoda@uxf.cz>",

@@ -9,2 +9,4 @@ import { ImageSource, ResizerImageProps } from "./resizer";

export declare function getImgUniqueIdentifier(src: ImageSource): string | undefined;
export declare function getImgElementHeight(src: ImageSource, width: number | undefined, height: number | undefined): number | undefined;
export declare function getImgElementWidth(src: ImageSource, width: number | undefined, height: number | undefined): number | undefined;
export declare function getImgSrcSet(src?: ImageSource, width?: Dimension, height?: Dimension, options?: ResizerImageProps): string | undefined;

@@ -11,0 +13,0 @@ interface ImageSourcesProps {

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ImgSources = exports.getImgSrcSet = exports.getImgUniqueIdentifier = exports.getImgQuality = exports.getSvgImgUrl = void 0;
exports.ImgSources = exports.getImgSrcSet = exports.getImgElementWidth = exports.getImgElementHeight = exports.getImgUniqueIdentifier = exports.getImgQuality = exports.getSvgImgUrl = void 0;
const file_1 = require("./file");

@@ -45,2 +45,16 @@ const resizer_1 = require("./resizer");

exports.getImgUniqueIdentifier = getImgUniqueIdentifier;
function getImgElementHeight(src, width, height) {
var _a, _b;
return typeof src === "string"
? height
: height !== null && height !== void 0 ? height : (Math.floor((((_a = src.height) !== null && _a !== void 0 ? _a : 0) / ((_b = src.width) !== null && _b !== void 0 ? _b : 0)) * (width || 0)) || undefined);
}
exports.getImgElementHeight = getImgElementHeight;
function getImgElementWidth(src, width, height) {
var _a, _b;
return typeof src === "string"
? width
: width !== null && width !== void 0 ? width : (Math.floor(((_a = src.width) !== null && _a !== void 0 ? _a : 0) / ((_b = src.height) !== null && _b !== void 0 ? _b : 0)) * (height || 0) || undefined);
}
exports.getImgElementWidth = getImgElementWidth;
const HIDPI_SIZES = [3, 2, 1];

@@ -77,3 +91,3 @@ function getImgSrcSet(src, width, height, options = {}) {

if (typeof h === "number" || typeof w === "number") {
return HIDPI_SIZES.map((size) => (0, resizer_1.resizerImageUrl)(src, w * size, h * size, {
return HIDPI_SIZES.map((size) => (0, resizer_1.resizerImageUrl)(src, typeof w === "number" ? w * size : "auto", typeof h === "number" ? h * size : "auto", {
toFormat,

@@ -80,0 +94,0 @@ ...options,

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

var _a, _b;
if (source === null || source === undefined) {
if (source === null || source === undefined || source === "") {
return undefined;

@@ -54,0 +54,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc