Socket
Socket
Sign inDemoInstall

hubot-help

Package Overview
Dependencies
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubot-help - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

46

package.json
{
"name": "hubot-help",
"description": "A hubot script to show available hubot commands",
"version": "1.0.1",
"version": "1.1.0",
"publishConfig": {

@@ -24,26 +24,6 @@ "tag": "next"

},
"peerDependencies": {
"hubot": ">=2 <10 || 0.0.0-development"
},
"devDependencies": {
"chai": "^3.5.0",
"coveralls": "^2.13.1",
"grunt": "^1.0.1",
"grunt-contrib-watch": "^1.0.0",
"grunt-mocha-test": "^0.7.0",
"grunt-release": "^0.14.0",
"hubot": "^3.0.0",
"hubot-mock-adapter-v3": "^1.0.0",
"matchdep": "^0.1.2",
"mocha": "^3.0.2",
"nyc": "^11.0.3",
"sinon": "^1.4.2",
"sinon-chai": "^2.8.0",
"standard": "^10.0.2",
"semantic-release": "^6.3.6"
},
"main": "index.coffee",
"main": "index.js",
"scripts": {
"pretest": "standard",
"test": "nyc --reporter=html --reporter=text mocha",
"test": "nyc --reporter=html --reporter=text mocha --exit",
"coverage": "nyc report --reporter=text-lcov | coveralls",

@@ -55,3 +35,19 @@ "semantic-release": "semantic-release pre && npm publish && semantic-release post"

"src"
]
}
],
"devDependencies": {
"chai": "^4.3.7",
"coveralls": "^3.1.1",
"hubot-mock-adapter-v3": "^1.0.1",
"hubot-test-helper": "^1.9.0",
"matchdep": "^2.0.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"semantic-release": "^21.0.2",
"sinon": "^15.0.4",
"sinon-chai": "^3.7.0",
"standard": "^17.0.0"
},
"dependencies": {
"hubot": "^3.4.0"
}
}

@@ -8,3 +8,3 @@ Hubot Help Plugin

See [`src/help.coffee`](src/help.coffee) for full documentation.
See [`src/help.js`](src/help.js) for full documentation.

@@ -11,0 +11,0 @@ Installation

@@ -14,3 +14,3 @@ 'use strict'

// Configuration:
// HUBOT_HELP_REPLY_IN_PRIVATE - if set to any avlue, all `hubot help` replies are sent in private
// HUBOT_HELP_REPLY_IN_PRIVATE - if set to any value, all `hubot help` replies are sent in private
// HUBOT_HELP_DISABLE_HTTP - if set, no web entry point will be declared

@@ -22,4 +22,2 @@ // HUBOT_HELP_HIDDEN_COMMANDS - comma-separated list of commands that will not be displayed in help

/* global renamedHelpCommands */
const helpContents = (name, commands) => `\

@@ -65,4 +63,2 @@ <!DOCTYPE html>

module.exports = (robot) => {
const replyInPrivate = process.env.HUBOT_HELP_REPLY_IN_PRIVATE
robot.respond(/help(?:\s+(.*))?$/i, (msg) => {

@@ -82,5 +78,5 @@ let cmds = getHelpCommands(robot)

if (replyInPrivate && msg.message && msg.message.user && msg.message.user.name) {
msg.reply('replied to you in private!')
return robot.send({ room: msg.message.user.name }, emit)
if (process.env.HUBOT_HELP_REPLY_IN_PRIVATE && msg.message && msg.message.user && msg.message.user.name && msg.message.user.name !== msg.message.room) {
msg.reply('I just replied to you in private.')
return robot.send({ room: msg.message.user.id }, emit)
} else {

@@ -93,3 +89,3 @@ return msg.send(emit)

return robot.router.get(`/${robot.name}/help`, (req, res) => {
let cmds = renamedHelpCommands(robot).map(cmd => cmd.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'))
let cmds = getHelpCommands(robot).map(cmd => cmd.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'))

@@ -110,3 +106,3 @@ if (req.query.q != null) {

var getHelpCommands = function getHelpCommands (robot) {
const getHelpCommands = function getHelpCommands (robot) {
let helpCommands = robot.helpCommands()

@@ -131,4 +127,4 @@

var hiddenCommandsPattern = function hiddenCommandsPattern () {
const hiddenCommands = process.env.HUBOT_HELP_HIDDEN_COMMANDS != null ? process.env.HUBOT_HELP_HIDDEN_COMMANDS.split(',') : undefined
const hiddenCommandsPattern = function hiddenCommandsPattern () {
const hiddenCommands = process.env.HUBOT_HELP_HIDDEN_COMMANDS != null ? process.env.HUBOT_HELP_HIDDEN_COMMANDS.split(',').map(c => c.trim()) : undefined
if (hiddenCommands) {

@@ -135,0 +131,0 @@ return new RegExp(`^hubot (?:${hiddenCommands != null ? hiddenCommands.join('|') : undefined}) - `)

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