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

qreator

Package Overview
Dependencies
Maintainers
0
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.6.0 to 9.7.0

68

lib/browser/png.umd.js

@@ -1180,2 +1180,7 @@ (function (global, factory) {

}
const svgMove = (left, top) => ['M', left, top];
const svgReturn = () => ['z'];
const svgDeltaArc = (borderRadius, dx, dy, sweep = 0) => borderRadius > 0 ? ['a', borderRadius, borderRadius, 0, 0, sweep, dx, dy] : [];
const svgVerticalDeltaLite = (dy) => ['v', dy];
const svgHorizontalDeltaLine = (dx) => ['h', dx];
function getFindersSVGPath(matrix, size = 0, margin = 0, borderRadius = 0) {

@@ -1188,16 +1193,21 @@ const matrixSize = matrix.length * size + margin * 2;

for (const side of sides) {
const signs = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
const [xSign, ySign] = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
for (const offset of [0, 1, 2]) {
let corners = [
[matrixSize * side[0] + signs[0] * (margin + size * offset), matrixSize * side[1] + signs[1] * (margin + size * offset)],
[matrixSize * side[0] + signs[0] * (margin + size * (finderEnd - offset)), matrixSize * side[1] + signs[1] * (margin + size * (finderEnd - offset))],
];
let xCorner = matrixSize * side[0] + xSign * (margin + size * offset);
let yCorner = matrixSize * side[1] + ySign * (margin + size * offset);
const xDelta = xSign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
const yDelta = ySign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
let rectangle = [
'M', corners[0][0], corners[0][1],
'L', corners[0][0], corners[1][1],
'L', corners[1][0], corners[1][1],
'L', corners[1][0], corners[0][1],
'z',
svgMove(xCorner, yCorner + borderRadius * ySign),
svgVerticalDeltaLite(yDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, borderRadius * ySign, side[1] | side[0]),
svgHorizontalDeltaLine(xDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, -borderRadius * ySign, (side[1] | side[0])),
svgVerticalDeltaLite(-yDelta),
svgDeltaArc(borderRadius, -borderRadius * xSign, -borderRadius * ySign, (side[1] | side[0])),
svgHorizontalDeltaLine(-xDelta),
svgDeltaArc(borderRadius, -borderRadius * xSign, borderRadius * ySign, (side[1] | side[0])),
svgReturn(),
];
rectangles.push(...rectangle);
rectangles.push(...rectangle.flat());
}

@@ -1214,25 +1224,17 @@ }

const leftX = x * size + margin;
const rightX = (x + 1) * size + margin;
const topY = y * size + margin;
const bottomY = (y + 1) * size + margin;
const rectangle = [];
rectangle.push(`M ${leftX} ${topY + borderRadius}`);
rectangle.push(`L ${leftX} ${bottomY - borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX + borderRadius} ${bottomY}`);
}
rectangle.push(`L ${rightX - borderRadius} ${bottomY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX} ${bottomY - borderRadius}`);
}
rectangle.push(`L ${rightX} ${topY + borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX - borderRadius} ${topY}`);
}
rectangle.push(`L ${leftX + borderRadius} ${topY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX} ${topY + borderRadius}`);
}
rectangle.push(`z`);
rectangles.push(rectangle.join(" "));
const delta = size - 2 * borderRadius;
const rectangle = [
svgMove(leftX, topY + borderRadius),
svgVerticalDeltaLite(delta),
svgDeltaArc(borderRadius, borderRadius, borderRadius),
svgHorizontalDeltaLine(delta),
svgDeltaArc(borderRadius, borderRadius, -borderRadius),
svgVerticalDeltaLite(-delta),
svgDeltaArc(borderRadius, -borderRadius, -borderRadius),
svgHorizontalDeltaLine(-delta),
svgDeltaArc(borderRadius, -borderRadius, borderRadius),
svgReturn(),
];
rectangles.push(...rectangle.flat());
}

@@ -1239,0 +1241,0 @@ }

@@ -1218,2 +1218,7 @@ (function (global, factory) {

}
const svgMove = (left, top) => ['M', left, top];
const svgReturn = () => ['z'];
const svgDeltaArc = (borderRadius, dx, dy, sweep = 0) => borderRadius > 0 ? ['a', borderRadius, borderRadius, 0, 0, sweep, dx, dy] : [];
const svgVerticalDeltaLite = (dy) => ['v', dy];
const svgHorizontalDeltaLine = (dx) => ['h', dx];
function getFindersSVGPath(matrix, size = 0, margin = 0, borderRadius = 0) {

@@ -1226,16 +1231,21 @@ const matrixSize = matrix.length * size + margin * 2;

for (const side of sides) {
const signs = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
const [xSign, ySign] = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
for (const offset of [0, 1, 2]) {
let corners = [
[matrixSize * side[0] + signs[0] * (margin + size * offset), matrixSize * side[1] + signs[1] * (margin + size * offset)],
[matrixSize * side[0] + signs[0] * (margin + size * (finderEnd - offset)), matrixSize * side[1] + signs[1] * (margin + size * (finderEnd - offset))],
];
let xCorner = matrixSize * side[0] + xSign * (margin + size * offset);
let yCorner = matrixSize * side[1] + ySign * (margin + size * offset);
const xDelta = xSign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
const yDelta = ySign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
let rectangle = [
'M', corners[0][0], corners[0][1],
'L', corners[0][0], corners[1][1],
'L', corners[1][0], corners[1][1],
'L', corners[1][0], corners[0][1],
'z',
svgMove(xCorner, yCorner + borderRadius * ySign),
svgVerticalDeltaLite(yDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, borderRadius * ySign, side[1] | side[0]),
svgHorizontalDeltaLine(xDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, -borderRadius * ySign, (side[1] | side[0])),
svgVerticalDeltaLite(-yDelta),
svgDeltaArc(borderRadius, -borderRadius * xSign, -borderRadius * ySign, (side[1] | side[0])),
svgHorizontalDeltaLine(-xDelta),
svgDeltaArc(borderRadius, -borderRadius * xSign, borderRadius * ySign, (side[1] | side[0])),
svgReturn(),
];
rectangles.push(...rectangle);
rectangles.push(...rectangle.flat());
}

@@ -1252,25 +1262,17 @@ }

const leftX = x * size + margin;
const rightX = (x + 1) * size + margin;
const topY = y * size + margin;
const bottomY = (y + 1) * size + margin;
const rectangle = [];
rectangle.push(`M ${leftX} ${topY + borderRadius}`);
rectangle.push(`L ${leftX} ${bottomY - borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX + borderRadius} ${bottomY}`);
}
rectangle.push(`L ${rightX - borderRadius} ${bottomY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX} ${bottomY - borderRadius}`);
}
rectangle.push(`L ${rightX} ${topY + borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX - borderRadius} ${topY}`);
}
rectangle.push(`L ${leftX + borderRadius} ${topY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX} ${topY + borderRadius}`);
}
rectangle.push(`z`);
rectangles.push(rectangle.join(" "));
const delta = size - 2 * borderRadius;
const rectangle = [
svgMove(leftX, topY + borderRadius),
svgVerticalDeltaLite(delta),
svgDeltaArc(borderRadius, borderRadius, borderRadius),
svgHorizontalDeltaLine(delta),
svgDeltaArc(borderRadius, borderRadius, -borderRadius),
svgVerticalDeltaLite(-delta),
svgDeltaArc(borderRadius, -borderRadius, -borderRadius),
svgHorizontalDeltaLine(-delta),
svgDeltaArc(borderRadius, -borderRadius, borderRadius),
svgReturn(),
];
rectangles.push(...rectangle.flat());
}

@@ -1277,0 +1279,0 @@ }

@@ -13,2 +13,7 @@ import colorString from "color-string";

}
const svgMove = (left, top) => ['M', left, top];
const svgReturn = () => ['z'];
const svgDeltaArc = (borderRadius, dx, dy, sweep = 0) => borderRadius > 0 ? ['a', borderRadius, borderRadius, 0, 0, sweep, dx, dy] : [];
const svgVerticalDeltaLite = (dy) => ['v', dy];
const svgHorizontalDeltaLine = (dx) => ['h', dx];
export function getFindersSVGPath(matrix, size = 0, margin = 0, borderRadius = 0) {

@@ -21,16 +26,21 @@ const matrixSize = matrix.length * size + margin * 2;

for (const side of sides) {
const signs = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
const [xSign, ySign] = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
for (const offset of [0, 1, 2]) {
let corners = [
[matrixSize * side[0] + signs[0] * (margin + size * offset), matrixSize * side[1] + signs[1] * (margin + size * offset)],
[matrixSize * side[0] + signs[0] * (margin + size * (finderEnd - offset)), matrixSize * side[1] + signs[1] * (margin + size * (finderEnd - offset))],
];
let xCorner = matrixSize * side[0] + xSign * (margin + size * offset);
let yCorner = matrixSize * side[1] + ySign * (margin + size * offset);
const xDelta = xSign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
const yDelta = ySign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
let rectangle = [
'M', corners[0][0], corners[0][1],
'L', corners[0][0], corners[1][1],
'L', corners[1][0], corners[1][1],
'L', corners[1][0], corners[0][1],
'z',
svgMove(xCorner, yCorner + borderRadius * ySign),
svgVerticalDeltaLite(yDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, borderRadius * ySign, side[1] | side[0]),
svgHorizontalDeltaLine(xDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, -borderRadius * ySign, (side[1] | side[0])),
svgVerticalDeltaLite(-yDelta),
svgDeltaArc(borderRadius, -borderRadius * xSign, -borderRadius * ySign, (side[1] | side[0])),
svgHorizontalDeltaLine(-xDelta),
svgDeltaArc(borderRadius, -borderRadius * xSign, borderRadius * ySign, (side[1] | side[0])),
svgReturn(),
];
rectangles.push(...rectangle);
rectangles.push(...rectangle.flat());
}

@@ -47,25 +57,17 @@ }

const leftX = x * size + margin;
const rightX = (x + 1) * size + margin;
const topY = y * size + margin;
const bottomY = (y + 1) * size + margin;
const rectangle = [];
rectangle.push(`M ${leftX} ${topY + borderRadius}`);
rectangle.push(`L ${leftX} ${bottomY - borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX + borderRadius} ${bottomY}`);
}
rectangle.push(`L ${rightX - borderRadius} ${bottomY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX} ${bottomY - borderRadius}`);
}
rectangle.push(`L ${rightX} ${topY + borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX - borderRadius} ${topY}`);
}
rectangle.push(`L ${leftX + borderRadius} ${topY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX} ${topY + borderRadius}`);
}
rectangle.push(`z`);
rectangles.push(rectangle.join(" "));
const delta = size - 2 * borderRadius;
const rectangle = [
svgMove(leftX, topY + borderRadius),
svgVerticalDeltaLite(delta),
svgDeltaArc(borderRadius, borderRadius, borderRadius),
svgHorizontalDeltaLine(delta),
svgDeltaArc(borderRadius, borderRadius, -borderRadius),
svgVerticalDeltaLite(-delta),
svgDeltaArc(borderRadius, -borderRadius, -borderRadius),
svgHorizontalDeltaLine(-delta),
svgDeltaArc(borderRadius, -borderRadius, borderRadius),
svgReturn(),
];
rectangles.push(...rectangle.flat());
}

@@ -72,0 +74,0 @@ }

{
"name": "qreator",
"version": "9.6.0",
"version": "9.7.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",

@@ -17,3 +17,9 @@ import colorString from "color-string";

const svgMove = (left: number, top: number) => ['M', left, top]
const svgReturn = () => ['z']
const svgDeltaArc = (borderRadius: number, dx: number, dy: number, sweep: number = 0) => borderRadius > 0 ? ['a', borderRadius, borderRadius, 0, 0, sweep, dx, dy] : [];
const svgVerticalDeltaLite = (dy: number) => ['v', dy];
const svgHorizontalDeltaLine = (dx: number) => ['h', dx];
export function getFindersSVGPath(matrix: Matrix, size: number = 0, margin: number = 0, borderRadius: number = 0) {

@@ -23,19 +29,25 @@ const matrixSize = matrix.length * size + margin * 2;

let finderEnd = finderSize - 1;
const sides = [[0, 0], [1, 0], [0, 1]]
const sides = [[0, 0], [1, 0], [0, 1]] as const;
const rectangles = [];
for (const side of sides) {
const signs = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
const [ xSign, ySign ] = side.map(sidePoint => sidePoint == 0 ? 1 : -1);
for (const offset of [0, 1, 2]) {
let corners = [
[matrixSize * side[0] + signs[0] * (margin + size * offset), matrixSize * side[1] + signs[1] * (margin + size * offset)],
[matrixSize * side[0] + signs[0] * (margin + size * (finderEnd - offset)), matrixSize * side[1] + signs[1] * (margin + size * (finderEnd - offset))],
]
let xCorner = matrixSize * side[0] + xSign * (margin + size * offset);
let yCorner = matrixSize * side[1] + ySign * (margin + size * offset);
const xDelta = xSign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
const yDelta = ySign * (size * (finderEnd - 2 * offset) - 2 * borderRadius);
let rectangle = [
'M', corners[0][0], corners[0][1],
'L', corners[0][0], corners[1][1],
'L', corners[1][0], corners[1][1],
'L', corners[1][0], corners[0][1],
'z',
svgMove(xCorner, yCorner + borderRadius * ySign),
svgVerticalDeltaLite(yDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, borderRadius * ySign, side[1] | side[0]),
svgHorizontalDeltaLine(xDelta),
svgDeltaArc(borderRadius, borderRadius * xSign, - borderRadius * ySign, (side[1] | side[0])),
svgVerticalDeltaLite(-yDelta),
svgDeltaArc(borderRadius, - borderRadius * xSign, - borderRadius * ySign, (side[1] | side[0])),
svgHorizontalDeltaLine(-xDelta),
svgDeltaArc(borderRadius, - borderRadius * xSign, borderRadius * ySign, (side[1] | side[0])),
svgReturn(),
]
rectangles.push(...rectangle)
rectangles.push(...rectangle.flat())
}

@@ -54,25 +66,17 @@ }

const leftX = x * size + margin;
const rightX = (x + 1) * size + margin;
const topY = y * size + margin;
const bottomY = (y + 1) * size + margin;
const rectangle = [];
rectangle.push(`M ${leftX} ${topY + borderRadius}`);
rectangle.push(`L ${leftX} ${bottomY - borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX + borderRadius} ${bottomY}`);
}
rectangle.push(`L ${rightX - borderRadius} ${bottomY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX} ${bottomY - borderRadius}`);
}
rectangle.push(`L ${rightX} ${topY + borderRadius}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${rightX - borderRadius} ${topY}`);
}
rectangle.push(`L ${leftX + borderRadius} ${topY}`);
if (borderRadius > 0) {
rectangle.push(`A ${borderRadius} ${borderRadius} 0 0 0 ${leftX} ${topY + borderRadius}`);
}
rectangle.push(`z`);
rectangles.push(rectangle.join(" "));
const delta = size - 2 * borderRadius;
const rectangle = [
svgMove(leftX, topY + borderRadius),
svgVerticalDeltaLite(delta),
svgDeltaArc(borderRadius, borderRadius, borderRadius),
svgHorizontalDeltaLine(delta),
svgDeltaArc(borderRadius, borderRadius, -borderRadius),
svgVerticalDeltaLite(-delta),
svgDeltaArc(borderRadius, -borderRadius, -borderRadius),
svgHorizontalDeltaLine(-delta),
svgDeltaArc(borderRadius, -borderRadius, borderRadius),
svgReturn(),
];
rectangles.push(...rectangle.flat());
}

@@ -79,0 +83,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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