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

@11ty/eleventy-img

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@11ty/eleventy-img - npm Package Compare versions

Comparing version 5.0.0-beta.10 to 5.0.0

16

img.js

@@ -371,7 +371,13 @@ const path = require("path");

// remove all newlines for hashing for better cross-OS hash compatibility (Issue #122)
let fileContentsStr = fileContents.toString();
let firstFour = fileContentsStr.trim().slice(0, 5);
if(firstFour === "<svg " || firstFour === "<?xml") {
fileContents = fileContentsStr.replace(/\r|\n/g, '');
// If the file starts with whitespace or the '<' character, it might be SVG.
// Otherwise, skip the expensive buffer.toString() call
// (no point in unicode encoding a binary file)
let fileContentsPrefix = fileContents?.slice(0, 1)?.toString()?.trim();
if (!fileContentsPrefix || fileContentsPrefix[0] == "<") {
// remove all newlines for hashing for better cross-OS hash compatibility (Issue #122)
let fileContentsStr = fileContents.toString();
let firstFour = fileContentsStr.trim().slice(0, 5);
if(firstFour === "<svg " || firstFour === "<?xml") {
fileContents = fileContentsStr.replace(/\r|\n/g, '');
}
}

@@ -378,0 +384,0 @@

{
"name": "@11ty/eleventy-img",
"version": "5.0.0-beta.10",
"version": "5.0.0",
"description": "Low level utility to perform build-time image transformations.",

@@ -43,10 +43,10 @@ "publishConfig": {

"brotli-size": "^4.0.0",
"debug": "^4.3.5",
"debug": "^4.3.7",
"entities": "^5.0.0",
"image-size": "^1.1.1",
"p-queue": "^6.6.2",
"sharp": "^0.33.4"
"sharp": "^0.33.5"
},
"devDependencies": {
"@11ty/eleventy": "3.0.0-alpha.10",
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-plugin-webc": "^0.11.2",

@@ -53,0 +53,0 @@ "ava": "^6.1.3",

@@ -86,3 +86,3 @@ const path = require("path");

tree.match({ tag: 'img' }, (node) => {
if(isIgnored(node)) {
if(isIgnored(node) || node?.attrs?.src?.startsWith("data:")) {
cleanTag(node);

@@ -89,0 +89,0 @@ } else {

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