@creejs/commons-events 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/event.js +2 -0
  2. package/package.json +4 -8
package/lib/event.js CHANGED
@@ -5,6 +5,7 @@ const { TypeUtils: { isFunction, isNil }, TypeAssert: { assertStringOrSymbol } }
5
5
  // eslint-disable-next-line no-unused-vars
6
6
  const Listener = require('./listener')
7
7
  const { DefaultOwner } = require('./constants')
8
+ const { assertFunction } = require('@creejs/commons-lang/lib/type-assert')
8
9
 
9
10
  // module vars
10
11
 
@@ -191,6 +192,7 @@ class Event {
191
192
  if (isNil(callback)) {
192
193
  return false
193
194
  }
195
+ assertFunction(callback)
194
196
  if (!this._callbacks.has(callback)) {
195
197
  this._callbacks.add(callback)
196
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creejs/commons-events",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Commons EventEmitter",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -19,15 +19,11 @@
19
19
  },
20
20
  "scripts": {
21
21
  "dts": "tsc",
22
- "generate-docs": "node_modules/.bin/jsdoc -c ./jsdoc.json"
22
+ "generate-docs": "../../node_modules/.bin/jsdoc -c ./jsdoc.json"
23
23
  },
24
24
  "author": "rodney.vin@gmail.com",
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@creejs/commons-lang": "^1.0.0"
28
- },
29
- "devDependencies": {
30
- "better-docs": "^2.7.3",
31
- "jsdoc": "^4.0.4"
27
+ "@creejs/commons-lang": "^1.0.3"
32
28
  }
33
- }
29
+ }