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

@ribajs/shopify

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ribajs/shopify - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

riba-cli.json

6

package.json
{
"name": "@ribajs/shopify",
"description": "Shopify extension for Riba.js",
"version": "1.2.0",
"version": "1.2.1",
"author": "Pascal Garber <pascal@jumplink.eu>",

@@ -44,5 +44,5 @@ "contributors": [],

"dependencies": {
"@ribajs/core": "^1.2.0",
"@ribajs/i18n": "^1.2.0"
"@ribajs/core": "^1.2.1",
"@ribajs/i18n": "^1.2.1"
}
}

@@ -1,2 +0,2 @@

import { IFormatter } from '@ribajs/core';
import { IFormatter, Utils } from '@ribajs/core';

@@ -15,7 +15,20 @@ /**

name: 'img_url',
read(url: string, size: string, scale: number, crop: string, extension: string) {
read(url: string, size: string, scale?: number, crop?: string, extension?: string, element?: HTMLImageElement) {
try {
if ('original' === size || 'master' === size) {
if (size === 'original' || size === 'master') {
return url;
}
if (size === 'auto') {
scale = window.devicePixelRatio;
let width: number = 0;
if (element) {
width = element.offsetWidth;
} else {
width = Utils.getViewportDimensions().w;
}
size = width + 'x';
}
if (scale && scale !== 1) {
size += '@' + scale + 'x';
}
const result = url.match(/(.*\/[\w\-\_\.]+)\.(\w{2,4})/);

@@ -22,0 +35,0 @@

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