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

qreator

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qreator - npm Package Compare versions

Comparing version 9.2.1 to 9.3.0

7

lib/png.js

@@ -13,2 +13,5 @@ import { QR } from "./qr-base.js";

const imageSize = matrix.length * size + marginPx * 2;
if (size > 200) {
throw new Error('Module size is too big, resulting image is too large: ' + imageSize);
}
const svg = await createSVG({

@@ -29,5 +32,7 @@ matrix, size, margin, color, bgColor,

}
const { data } = await qrImage.png().toBuffer({ resolveWithObject: true });
const { data } = await qrImage.png({
palette: !logo,
}).toBuffer({ resolveWithObject: true });
return new Uint8ClampedArray(data.buffer);
}
//# sourceMappingURL=png.js.map

2

lib/tests/test.js

@@ -232,3 +232,3 @@ import test from "ava";

filename: "qr_large.png",
params: { size: 300, margin: 10 },
params: { size: 199, margin: 10 },
}

@@ -235,0 +235,0 @@ ].forEach((testData) => {

{
"name": "qreator",
"version": "9.2.1",
"version": "9.3.0",
"description": "QR Code generator for browser and node.js with tree shaking and logo support",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/Short-io/qreator",

@@ -26,2 +26,5 @@ import { ImageOptions, Matrix } from "./typing/types";

const imageSize = matrix.length * size + marginPx * 2;
if (size > 200) {
throw new Error('Module size is too big, resulting image is too large: ' + imageSize);
}
const svg = await createSVG({

@@ -42,4 +45,6 @@ matrix, size, margin, color, bgColor,

}
const { data } = await qrImage.png().toBuffer({ resolveWithObject: true});
const { data } = await qrImage.png({
palette: !logo, // no logo results in much less colors
}).toBuffer({ resolveWithObject: true});
return new Uint8ClampedArray(data.buffer);
}

@@ -245,3 +245,3 @@ import test from "ava";

filename: "qr_large.png",
params: { size: 300, margin: 10 },
params: { size: 199, margin: 10 },
}

@@ -248,0 +248,0 @@ ] as TestParams[]).forEach((testData) => {

Sorry, the diff of this file is not supported yet

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