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

pam-diff

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pam-diff - npm Package Compare versions

Comparing version 0.8.5 to 0.9.1

37

index.js

@@ -8,5 +8,5 @@ // jshint esversion: 6, globalstrict: true, strict: true, bitwise: false

function PamDiff(options) {
function PamDiff(options, callback) {
if (!(this instanceof PamDiff)) {
return new PamDiff(options);
return new PamDiff(options, callback);
}

@@ -18,2 +18,3 @@ Transform.call(this, {objectMode: true});

this.setRegions(this._parseOptions('regions', options));//can be no regions or a single region or multiple regions. if no regions, all pixels will be compared.
this._setCallback(callback);//callback function to be called when pixel difference is detected
this._parseChunk = this._parseFirstChunk;//first parsing will be reading settings and configuring internal pixel reading

@@ -92,2 +93,10 @@ }

PamDiff.prototype._setCallback = function (callback) {
if (typeof callback === 'function') {
this._callback = callback;
} else {
delete this._callback;
}
};
PamDiff.prototype._parseOptions = function (option, options) {

@@ -186,2 +195,5 @@ if (options && options.hasOwnProperty(option)) {

const data = {trigger: regionDiffArray, pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -198,2 +210,5 @@ this.push(data);

const data = {trigger: [{name: 'percent', percent: percent}], pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -242,2 +257,5 @@ this.push(data);

const data = {trigger: regionDiffArray, pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -254,2 +272,5 @@ this.push(data);

const data = {trigger: [{name: 'percent', percent: percent}], pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -298,2 +319,5 @@ this.push(data);

const data = {trigger: regionDiffArray, pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -310,2 +334,5 @@ this.push(data);

const data = {trigger: [{name: 'percent', percent: percent}], pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -354,2 +381,5 @@ this.push(data);

const data = {trigger: regionDiffArray, pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -366,2 +396,5 @@ this.push(data);

const data = {trigger: [{name: 'percent', percent: percent}], pam: chunk.pam};
if (this._callback) {
this._callback(data);
}
if (this._readableState.pipesCount > 0) {

@@ -368,0 +401,0 @@ this.push(data);

2

package.json
{
"name": "pam-diff",
"version": "0.8.5",
"version": "0.9.1",
"description": "Measure differences between pixel arrays extracted from pam images",

@@ -5,0 +5,0 @@ "main": "index.js",

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