New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-notify

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

gulp-notify - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

1

lib/notify.js

@@ -23,3 +23,2 @@ var through = require("through2");

var stream = this;
report(reporter, file, options, templateOptions, function (err) {

@@ -26,0 +25,0 @@ err && stream.emit("error", err);

73

lib/report.js
var template = require("lodash.template");
var gutil = require("gulp-util");
var api = require("./extra_api");
var extend = require("node.extend");

@@ -26,5 +27,35 @@ "use strict";

function generate (outputData, object, title, message, templateOptions) {
if (object instanceof Error) {
var titleTemplate = template(title);
var messageTemplate = template(message);
return extend(outputData, {
title: titleTemplate({
error: object,
options: templateOptions
}),
message: messageTemplate({
error: object,
options: templateOptions
})
});
}
return extend(outputData, {
title: gutil.template(title, {
file: object,
options: templateOptions
}),
message: gutil.template(message, {
file: object,
options: templateOptions
})
});
}
function constructOptions (options, object, templateOptions) {
var message = object.path || object.message || object,
title = !(object instanceof Error) ? "Gulp notification" : "Error running Gulp";
title = !(object instanceof Error) ? "Gulp notification" : "Error running Gulp",
outputData = {};

@@ -40,40 +71,16 @@ if (typeof options === "function") {

if (typeof options === "object") {
if (typeof options.title === "function") {
title = options.title(object);
outputData = extend(true, {}, options);
if (typeof outputData.title === "function") {
title = outputData.title(object);
} else {
title = options.title || title;
title = outputData.title || title;
}
if (typeof options.message === "function") {
message = options.message(object);
if (typeof outputData.message === "function") {
message = outputData.message(object);
} else {
message = options.message || message;
message = outputData.message || message;
}
} else {
options = {};
}
if (object instanceof Error) {
var titleTemplate = template(title);
var messageTemplate = template(message);
options.title = titleTemplate({
error: object,
options: templateOptions
});
options.message = messageTemplate({
error: object,
options: templateOptions
});
} else {
options.title = gutil.template(title, {
file: object,
options: templateOptions
});
options.message = gutil.template(message, {
file: object,
options: templateOptions
});
}
return options;
return generate(outputData, object, title, message, templateOptions);
}
{
"name": "gulp-notify",
"version": "1.2.0",
"version": "1.2.1",
"description": "A plugin for Gulp to send messages to Mac Notification Center or Linux' notify-send",

@@ -31,3 +31,4 @@ "keywords": [

"lodash.template": "~2.4.1",
"node-notifier": "^2.0.0-alpha"
"node-notifier": "^2.0.2",
"node.extend": "^1.0.9"
},

@@ -34,0 +35,0 @@ "devDependencies": {

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