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

@jimp/utils

Package Overview
Dependencies
Maintainers
2
Versions
246
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/utils - npm Package Compare versions

Comparing version 0.8.5-canary.b147e81.0 to 0.8.5

62

dist/index.js

@@ -11,3 +11,10 @@ "use strict";

exports.scan = scan;
exports.scanIterator = scanIterator;
require("regenerator-runtime/runtime");
var _marked =
/*#__PURE__*/
regeneratorRuntime.mark(scanIterator);
function isNodePattern(cb) {

@@ -53,2 +60,57 @@ if (typeof cb === 'undefined') {

}
function scanIterator(image, x, y, w, h) {
var _y, _x, idx;
return regeneratorRuntime.wrap(function scanIterator$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
// round input
x = Math.round(x);
y = Math.round(y);
w = Math.round(w);
h = Math.round(h);
_y = y;
case 5:
if (!(_y < y + h)) {
_context.next = 17;
break;
}
_x = x;
case 7:
if (!(_x < x + w)) {
_context.next = 14;
break;
}
idx = image.bitmap.width * _y + _x << 2;
_context.next = 11;
return {
x: _x,
y: _y,
idx: idx,
image: image
};
case 11:
_x++;
_context.next = 7;
break;
case 14:
_y++;
_context.next = 5;
break;
case 17:
case "end":
return _context.stop();
}
}
}, _marked);
}
//# sourceMappingURL=index.js.map

@@ -0,1 +1,5 @@

var _marked =
/*#__PURE__*/
regeneratorRuntime.mark(scanIterator);
export function isNodePattern(cb) {

@@ -39,2 +43,56 @@ if (typeof cb === 'undefined') {

}
export function scanIterator(image, x, y, w, h) {
var _y, _x, idx;
return regeneratorRuntime.wrap(function scanIterator$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
// round input
x = Math.round(x);
y = Math.round(y);
w = Math.round(w);
h = Math.round(h);
_y = y;
case 5:
if (!(_y < y + h)) {
_context.next = 17;
break;
}
_x = x;
case 7:
if (!(_x < x + w)) {
_context.next = 14;
break;
}
idx = image.bitmap.width * _y + _x << 2;
_context.next = 11;
return {
x: _x,
y: _y,
idx: idx,
image: image
};
case 11:
_x++;
_context.next = 7;
break;
case 14:
_y++;
_context.next = 5;
break;
case 17:
case "end":
return _context.stop();
}
}
}, _marked);
}
//# sourceMappingURL=index.js.map

4

package.json
{
"name": "@jimp/utils",
"version": "0.8.5-canary.b147e81.0",
"version": "0.8.5",
"description": "Utils for jimp extensions.",

@@ -25,3 +25,3 @@ "main": "dist/index.js",

},
"gitHead": "b147e810972b2bba9bea4a132c3026ca119832e7"
"gitHead": "60b635dd77b6ea900043d81d09a12ff82fd14fd0"
}

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