Comparing version 1.1.16 to 1.1.17
@@ -19,8 +19,8 @@ var path = require( 'path' ) | ||
, watch_for = _watch_for.bind( this ) | ||
, user_join = _user_join.bind(this) | ||
, user_leave = _user_leave.bind(this) | ||
, user_join = _user_join.bind( this ) | ||
, user_leave = _user_leave.bind( this ) | ||
/* ------------------------------ Public Methods ------------------------------ */ | ||
this.addWatchers = function( block ) { | ||
block( { watch_for: watch_for, user_join: user_join, user_leave: user_leave} ) | ||
block( { watch_for: watch_for, user_join: user_join, user_leave: user_leave } ) | ||
return { connect: connect } | ||
@@ -43,2 +43,3 @@ } | ||
return { say: _privmsg_protected.bind( this ) | ||
, forget: _forget.bind( this ) | ||
, action: _bot_do( function( to, msg ) { return bot.privmsg( to, '\001ACTION ' + msg + '\001' ) } ).bind( this ) | ||
@@ -89,3 +90,3 @@ , part: _bot_do( 'part' ).bind( this ) | ||
while ( i-- ) | ||
if ( md = message.params.slice( -1 ).toString().match( watchers[i][0] ) ) | ||
if ( typeof watchers[i] != 'undefined' && ( md = message.params.slice( -1 ).toString().match( watchers[i][0] ) ) ) | ||
watchers[i][1]( _make_message( message, md ) ) | ||
@@ -125,2 +126,9 @@ } | ||
function _forget( pattern ) { | ||
var i, l, pattern = String( pattern ) | ||
for ( i = 0, l = watchers.length; i < l; i++ ) | ||
if ( pattern == String( watchers[i][0] ) ) | ||
delete watchers[i] | ||
} | ||
function _to_string() { | ||
@@ -127,0 +135,0 @@ return new Date().strftime( '[%H:%M]' ) + ' <' + this.user + '> ' + this.text |
@@ -11,3 +11,3 @@ { "name" : "jerk" | ||
, "homepage" : "http://github.com/gf3/Jerk" | ||
, "version" : "1.1.16" | ||
, "version" : "1.1.17" | ||
, "main" : "./lib/jerk" | ||
@@ -14,0 +14,0 @@ , "dependencies" : |
@@ -73,2 +73,3 @@ # Jerk | ||
, action: Function( destination, action ) | ||
, forget: Function( pattern ) | ||
, part: Function( channel ) | ||
@@ -75,0 +76,0 @@ , join: Function( channel ) |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18793
353
134
0