Socket
Socket
Sign inDemoInstall

modify-event

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

10

index.js

@@ -7,6 +7,8 @@ /*!

var util = require('util');
module.exports = function modifyEvent(eventEmitter, targetEventName, fn) {
if (!eventEmitter || typeof eventEmitter.emit !== 'function') {
throw new TypeError(
eventEmitter +
util.inspect(eventEmitter) +
' doesn\'t have "emit" method.' +

@@ -20,3 +22,3 @@ ' The first argument to modify-event must be an instance of EventEmitter' +

throw new TypeError(
targetEventName +
util.inspect(targetEventName) +
' is not a string. The second argument to modify-event must be an event name.'

@@ -28,3 +30,3 @@ );

throw new TypeError(
fn +
util.inspect(fn) +
' is not a function. The third argument to modify-event must be a function.'

@@ -36,3 +38,3 @@ );

eventEmitter.emit = function(eventName, val) {
eventEmitter.emit = function modifiedEmit(eventName, val) {
if (eventName === targetEventName) {

@@ -39,0 +41,0 @@ val = fn(val);

30

package.json
{
"name": "modify-event",
"version": "1.0.0",
"version": "1.0.1",
"description": "Modify the value of the specific object's event",
"repository": "shinnn/modify-event",
"author": "Shinnosuke Watanabe <snnskwtnb@gmail.com> (https://github.com/shinnn)",
"scripts": {
"pretest": "eslint --config node_modules/@shinnn/eslintrc-node/rc.json index.js test.js",
"test": "node test.js | tap-spec",
"coverage": "istanbul cover test.js",
"coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls"
"pretest": "eslint --fix --config @shinnn/node-legacy index.js test.js",
"test": "node --strong_mode --throw-deprecation --track-heap-objects test.js | tap-spec",
"coverage": "node --strong_mode --throw-deprecation --track-heap-objects node_modules/.bin/istanbul cover test.js"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/shinnn/modify-event/blob/master/LICENSE"
}
],
"license": "MIT",
"files": [

@@ -28,12 +23,13 @@ "index.js"

"change",
"filter",
"filtering",
"update"
],
"devDependencies": {
"@shinnn/eslintrc-node": "^1.0.1",
"eslint": "^0.20.0",
"istanbul": "^0.3.13",
"istanbul-coveralls": "^1.0.2",
"tap-spec": "^3.0.0",
"tape": "^4.0.0"
"@shinnn/eslint-config-node-legacy": "^2.0.0",
"eslint": "^2.9.0",
"istanbul": "^0.4.3",
"tap-spec": "^4.1.1",
"tape": "^4.5.1"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc