events-ex 2.1.1 → 2.3.0
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.
- package/CHANGELOG.md +20 -0
- package/README.cn.md +119 -170
- package/README.md +140 -150
- package/docs/README.md +143 -149
- package/docs/all-off/README.md +17 -0
- package/docs/all-off/functions/allOff.md +33 -0
- package/docs/consts/README.md +12 -0
- package/docs/consts/variables/RegExpEventSymbol.md +11 -0
- package/docs/consts/variables/states.md +29 -0
- package/docs/default-methods/README.md +17 -0
- package/docs/default-methods/functions/getEventableMethods.md +309 -0
- package/docs/event/README.md +17 -0
- package/docs/event/classes/Event.md +143 -0
- package/docs/event-emitter/README-1.md +17 -0
- package/docs/event-emitter/README.md +17 -0
- package/docs/event-emitter/classes/EventEmitter-1.md +29 -0
- package/docs/event-emitter/classes/EventEmitter.md +369 -0
- package/docs/eventable/README.md +17 -0
- package/docs/eventable/functions/eventable.md +82 -0
- package/docs/has-listeners/README.md +17 -0
- package/docs/has-listeners/functions/hasListeners.md +38 -0
- package/docs/index/README.md +85 -0
- package/docs/modules.md +24 -23
- package/docs/pipe/README.md +17 -0
- package/docs/pipe/functions/pipe.md +41 -0
- package/docs/pipe-async/README.md +17 -0
- package/docs/pipe-async/functions/pipeAsync.md +41 -0
- package/docs/unify/README.md +17 -0
- package/docs/unify/functions/unify.md +35 -0
- package/docs/util/array-remove/README.md +17 -0
- package/docs/util/array-remove/functions/remove.md +21 -0
- package/docs/util/object-for-each/README.md +17 -0
- package/docs/util/object-for-each/functions/forEach.md +29 -0
- package/docs/util/promise-any/README.md +11 -0
- package/docs/util/promise-any/variables/default.md +9 -0
- package/docs/util/string-pad/README.md +17 -0
- package/docs/util/string-pad/functions/pad.md +25 -0
- package/docs/util/to-int/README.md +17 -0
- package/docs/util/to-int/functions/toInt.md +21 -0
- package/docs/util/valid-callable/README.md +17 -0
- package/docs/util/valid-callable/functions/validCallable.md +21 -0
- package/docs/util/valid-object/README.md +17 -0
- package/docs/util/valid-object/functions/validObject.md +21 -0
- package/docs/wrap-event-emitter/README.md +21 -0
- package/docs/wrap-event-emitter/functions/wrapEventEmitter.md +33 -0
- package/docs/wrap-event-emitter/variables/methods.md +11 -0
- package/lib/all-off.d.ts +1 -1
- package/lib/all-off.js +1 -1
- package/lib/default-methods.d.ts +38 -7
- package/lib/default-methods.js +155 -32
- package/lib/event-emitter.d.ts +12 -2
- package/lib/event.d.ts +9 -3
- package/lib/event.js +6 -0
- package/lib/eventable.js +4 -1
- package/lib/pipe-async.d.ts +4 -1
- package/lib/pipe-async.js +39 -5
- package/lib/pipe.d.ts +1 -1
- package/lib/pipe.js +1 -1
- package/lib/unify.d.ts +1 -1
- package/lib/unify.js +1 -1
- package/lib/util/array-remove.js +1 -1
- package/lib/util/object-for-each.js +1 -1
- package/lib/util/promise-any.d.ts +1 -0
- package/lib/util/promise-any.js +44 -0
- package/lib/util/string-pad.js +1 -1
- package/lib/wrap-event-emitter.d.ts +2 -1
- package/lib/wrap-event-emitter.js +24 -3
- package/package.json +17 -17
- package/src/default-methods.js +159 -26
- package/src/event-emitter.d.ts +12 -2
- package/src/event.js +6 -0
- package/src/eventable.js +3 -0
- package/src/pipe-async.js +64 -30
- package/src/util/promise-any.js +45 -0
- package/src/wrap-event-emitter.js +23 -18
- package/docs/.nojekyll +0 -1
- package/docs/classes/event.Event.md +0 -141
- package/docs/classes/event_emitter-1.EventEmitter.md +0 -29
- package/docs/classes/event_emitter.EventEmitter.md +0 -352
- package/docs/modules/all_off.md +0 -44
- package/docs/modules/consts.md +0 -39
- package/docs/modules/default_methods.md +0 -51
- package/docs/modules/event.md +0 -19
- package/docs/modules/event_emitter-1.md +0 -19
- package/docs/modules/event_emitter.md +0 -19
- package/docs/modules/eventable.md +0 -92
- package/docs/modules/has_listeners.md +0 -49
- package/docs/modules/index.md +0 -99
- package/docs/modules/pipe.md +0 -49
- package/docs/modules/pipe_async.md +0 -49
- package/docs/modules/unify.md +0 -46
- package/docs/modules/util_array_remove.md +0 -39
- package/docs/modules/util_object_for_each.md +0 -41
- package/docs/modules/util_string_pad.md +0 -40
- package/docs/modules/util_to_int.md +0 -39
- package/docs/modules/util_valid_callable.md +0 -39
- package/docs/modules/util_valid_object.md +0 -39
- package/docs/modules/wrap_event_emitter.md +0 -57
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / eventable
|
|
2
|
-
|
|
3
|
-
# Module: eventable
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](eventable.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [eventable](eventable.md#eventable)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [eventable](eventable.md#eventable)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### eventable
|
|
24
|
-
|
|
25
|
-
▸ **eventable**\<`T`\>(`targetClass?`, `options?`): `EnhancedClass`\<`T`, (`aClass?`: `Function`) => `Function`\>
|
|
26
|
-
|
|
27
|
-
Adds event-emitting capabilities to a class by injecting necessary methods and properties.
|
|
28
|
-
|
|
29
|
-
This function uses `createAbilityInjector` from `custom-ability` to inject event-related methods
|
|
30
|
-
into the target class. The injected methods include standard EventEmitter functionality such as
|
|
31
|
-
`on`, `off`, `emit`, `emitAsync`, `once`, `listeners`, `@listenerCount` and more. It also ensures compatibility with Node.js `EventEmitter`
|
|
32
|
-
by including methods like `listenerCount`, `setMaxListeners`, `addListener`, `removeListener`, and `removeAllListeners`.
|
|
33
|
-
|
|
34
|
-
#### Type parameters
|
|
35
|
-
|
|
36
|
-
| Name | Type |
|
|
37
|
-
| :------ | :------ |
|
|
38
|
-
| `T` | extends `ClassEx` |
|
|
39
|
-
|
|
40
|
-
#### Parameters
|
|
41
|
-
|
|
42
|
-
| Name | Type | Description |
|
|
43
|
-
| :------ | :------ | :------ |
|
|
44
|
-
| `targetClass?` | `T` | - |
|
|
45
|
-
| `options?` | `AbilityOptions` | Optional configuration for the injection process: * `include` (string[]\|string): Specifies which methods should be added. Static methods should use the prefix '@'. * `exclude` (string[]\|string): Specifies which methods should not be added. Static methods should use the prefix '@'. * `methods` (Object): Custom methods to override or extend the default behavior. Use `this.super()` to call the original method and `this.self` to access the original context. * `classMethods` (Object): Custom static methods to be added to the class. |
|
|
46
|
-
|
|
47
|
-
#### Returns
|
|
48
|
-
|
|
49
|
-
`EnhancedClass`\<`T`, (`aClass?`: `Function`) => `Function`\>
|
|
50
|
-
|
|
51
|
-
The same `aClass` class with event capabilities injected. The return value is the modified `aClass` itself.
|
|
52
|
-
|
|
53
|
-
**`Function`**
|
|
54
|
-
|
|
55
|
-
eventable
|
|
56
|
-
|
|
57
|
-
**`Example`**
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
import { eventable } from 'events-ex';
|
|
61
|
-
|
|
62
|
-
class MyClass {}
|
|
63
|
-
|
|
64
|
-
// Inject only specific methods: 'on', 'off', 'emit', 'emitAsync', and the static 'listenerCount'
|
|
65
|
-
eventable(MyClass, { include: ['on', 'off', 'emit', 'emitAsync', '@listenerCount'] });
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**`Example`**
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
import { eventable } from 'events-ex';
|
|
72
|
-
|
|
73
|
-
class OtherClass {
|
|
74
|
-
exec() {
|
|
75
|
-
console.log("Original exec");
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Inject event capabilities and override the `exec` method
|
|
80
|
-
eventable(OtherClass, {
|
|
81
|
-
methods: {
|
|
82
|
-
exec() {
|
|
83
|
-
console.log("New exec");
|
|
84
|
-
this.super(); // Calls the original `exec` method
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
#### Defined in
|
|
91
|
-
|
|
92
|
-
node_modules/custom-ability/lib/custom-ability.d.ts:34
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / has-listeners
|
|
2
|
-
|
|
3
|
-
# Module: has-listeners
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](has_listeners.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [hasListeners](has_listeners.md#haslisteners)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [hasListeners](has_listeners.md#haslisteners)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### hasListeners
|
|
24
|
-
|
|
25
|
-
▸ **hasListeners**(`obj`, `type?`): `boolean`
|
|
26
|
-
|
|
27
|
-
Checks if an object has event listeners.
|
|
28
|
-
|
|
29
|
-
#### Parameters
|
|
30
|
-
|
|
31
|
-
| Name | Type | Description |
|
|
32
|
-
| :------ | :------ | :------ |
|
|
33
|
-
| `obj` | `any` | The object to check. Must not be null or undefined. |
|
|
34
|
-
| `type?` | `string` | Optional parameter specifying the event type. If provided, checks for the existence of listeners for this specific type. |
|
|
35
|
-
|
|
36
|
-
#### Returns
|
|
37
|
-
|
|
38
|
-
`boolean`
|
|
39
|
-
|
|
40
|
-
- If `type` is provided, returns whether listeners for the specified event type exist.
|
|
41
|
-
- If `type` is not provided, returns whether the object has any event listeners.
|
|
42
|
-
|
|
43
|
-
**`Throws`**
|
|
44
|
-
|
|
45
|
-
Throws a TypeError if `obj` is null or undefined.
|
|
46
|
-
|
|
47
|
-
#### Defined in
|
|
48
|
-
|
|
49
|
-
[src/has-listeners.js:20](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/has-listeners.js#L20)
|
package/docs/modules/index.md
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / index
|
|
2
|
-
|
|
3
|
-
# Module: index
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [Event](index.md#event)
|
|
10
|
-
- [EventEmitter](index.md#eventemitter)
|
|
11
|
-
- [RegExpEventSymbol](index.md#regexpeventsymbol)
|
|
12
|
-
- [allOff](index.md#alloff)
|
|
13
|
-
- [default](index.md#default)
|
|
14
|
-
- [eventable](index.md#eventable)
|
|
15
|
-
- [hasListeners](index.md#haslisteners)
|
|
16
|
-
- [methods](index.md#methods)
|
|
17
|
-
- [pipe](index.md#pipe)
|
|
18
|
-
- [pipeAsync](index.md#pipeasync)
|
|
19
|
-
- [states](index.md#states)
|
|
20
|
-
- [unify](index.md#unify)
|
|
21
|
-
- [wrapEventEmitter](index.md#wrapeventemitter)
|
|
22
|
-
|
|
23
|
-
## References
|
|
24
|
-
|
|
25
|
-
### Event
|
|
26
|
-
|
|
27
|
-
Re-exports [Event](../classes/event.Event.md)
|
|
28
|
-
|
|
29
|
-
___
|
|
30
|
-
|
|
31
|
-
### EventEmitter
|
|
32
|
-
|
|
33
|
-
Re-exports [EventEmitter](../classes/event_emitter.EventEmitter.md)
|
|
34
|
-
|
|
35
|
-
___
|
|
36
|
-
|
|
37
|
-
### RegExpEventSymbol
|
|
38
|
-
|
|
39
|
-
Re-exports [RegExpEventSymbol](consts.md#regexpeventsymbol)
|
|
40
|
-
|
|
41
|
-
___
|
|
42
|
-
|
|
43
|
-
### allOff
|
|
44
|
-
|
|
45
|
-
Re-exports [allOff](all_off.md#alloff)
|
|
46
|
-
|
|
47
|
-
___
|
|
48
|
-
|
|
49
|
-
### default
|
|
50
|
-
|
|
51
|
-
Renames and re-exports [EventEmitter](../classes/event_emitter.EventEmitter.md)
|
|
52
|
-
|
|
53
|
-
___
|
|
54
|
-
|
|
55
|
-
### eventable
|
|
56
|
-
|
|
57
|
-
Re-exports [eventable](eventable.md#eventable)
|
|
58
|
-
|
|
59
|
-
___
|
|
60
|
-
|
|
61
|
-
### hasListeners
|
|
62
|
-
|
|
63
|
-
Re-exports [hasListeners](has_listeners.md#haslisteners)
|
|
64
|
-
|
|
65
|
-
___
|
|
66
|
-
|
|
67
|
-
### methods
|
|
68
|
-
|
|
69
|
-
Re-exports [methods](wrap_event_emitter.md#methods)
|
|
70
|
-
|
|
71
|
-
___
|
|
72
|
-
|
|
73
|
-
### pipe
|
|
74
|
-
|
|
75
|
-
Re-exports [pipe](pipe.md#pipe)
|
|
76
|
-
|
|
77
|
-
___
|
|
78
|
-
|
|
79
|
-
### pipeAsync
|
|
80
|
-
|
|
81
|
-
Re-exports [pipeAsync](pipe_async.md#pipeasync)
|
|
82
|
-
|
|
83
|
-
___
|
|
84
|
-
|
|
85
|
-
### states
|
|
86
|
-
|
|
87
|
-
Re-exports [states](consts.md#states)
|
|
88
|
-
|
|
89
|
-
___
|
|
90
|
-
|
|
91
|
-
### unify
|
|
92
|
-
|
|
93
|
-
Re-exports [unify](unify.md#unify)
|
|
94
|
-
|
|
95
|
-
___
|
|
96
|
-
|
|
97
|
-
### wrapEventEmitter
|
|
98
|
-
|
|
99
|
-
Re-exports [wrapEventEmitter](wrap_event_emitter.md#wrapeventemitter)
|
package/docs/modules/pipe.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / pipe
|
|
2
|
-
|
|
3
|
-
# Module: pipe
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](pipe.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [pipe](pipe.md#pipe)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [pipe](pipe.md#pipe)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### pipe
|
|
24
|
-
|
|
25
|
-
▸ **pipe**(`e1`, `e2`, `...args`): `any`
|
|
26
|
-
|
|
27
|
-
Creates a pipeline between two event emitters, so that any events emitted by the first emitter are also emitted by the second emitter.
|
|
28
|
-
|
|
29
|
-
#### Parameters
|
|
30
|
-
|
|
31
|
-
| Name | Type | Description |
|
|
32
|
-
| :------ | :------ | :------ |
|
|
33
|
-
| `e1` | [`EventEmitter`](../classes/event_emitter.EventEmitter.md) | The first event emitter. |
|
|
34
|
-
| `e2` | [`EventEmitter`](../classes/event_emitter.EventEmitter.md) | The second event emitter. |
|
|
35
|
-
| `...args` | `any` | - |
|
|
36
|
-
|
|
37
|
-
#### Returns
|
|
38
|
-
|
|
39
|
-
`any`
|
|
40
|
-
|
|
41
|
-
- An object with a `close` method that removes the pipeline between the two event emitters.
|
|
42
|
-
|
|
43
|
-
**`Throws`**
|
|
44
|
-
|
|
45
|
-
- If either of the arguments is not an event emitter object.
|
|
46
|
-
|
|
47
|
-
#### Defined in
|
|
48
|
-
|
|
49
|
-
[src/pipe.js:21](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/pipe.js#L21)
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / pipe-async
|
|
2
|
-
|
|
3
|
-
# Module: pipe-async
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](pipe_async.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [pipeAsync](pipe_async.md#pipeasync)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [pipeAsync](pipe_async.md#pipeasync)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### pipeAsync
|
|
24
|
-
|
|
25
|
-
▸ **pipeAsync**(`e1`, `e2`, `...args`): `any`
|
|
26
|
-
|
|
27
|
-
Creates a pipeline between two event emitters, so that any events emitted by the first emitter are also emitted by the second emitter.
|
|
28
|
-
|
|
29
|
-
#### Parameters
|
|
30
|
-
|
|
31
|
-
| Name | Type | Description |
|
|
32
|
-
| :------ | :------ | :------ |
|
|
33
|
-
| `e1` | [`EventEmitter`](../classes/event_emitter.EventEmitter.md) | The first event emitter. |
|
|
34
|
-
| `e2` | [`EventEmitter`](../classes/event_emitter.EventEmitter.md) | The second event emitter. |
|
|
35
|
-
| `...args` | `any` | - |
|
|
36
|
-
|
|
37
|
-
#### Returns
|
|
38
|
-
|
|
39
|
-
`any`
|
|
40
|
-
|
|
41
|
-
- An object with a `close` method that removes the pipeline between the two event emitters.
|
|
42
|
-
|
|
43
|
-
**`Throws`**
|
|
44
|
-
|
|
45
|
-
- If either of the arguments is not an event emitter object.
|
|
46
|
-
|
|
47
|
-
#### Defined in
|
|
48
|
-
|
|
49
|
-
[src/pipe-async.js:21](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/pipe-async.js#L21)
|
package/docs/modules/unify.md
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / unify
|
|
2
|
-
|
|
3
|
-
# Module: unify
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](unify.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [unify](unify.md#unify)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [unify](unify.md#unify)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### unify
|
|
24
|
-
|
|
25
|
-
▸ **unify**(`e1`, `e2`): `void`
|
|
26
|
-
|
|
27
|
-
Unifies the event listeners of two event emitter objects so that they share the same set of listeners for each event.
|
|
28
|
-
|
|
29
|
-
#### Parameters
|
|
30
|
-
|
|
31
|
-
| Name | Type | Description |
|
|
32
|
-
| :------ | :------ | :------ |
|
|
33
|
-
| `e1` | [`EventEmitter`](../classes/event_emitter.EventEmitter.md) | The first event emitter object. |
|
|
34
|
-
| `e2` | [`EventEmitter`](../classes/event_emitter.EventEmitter.md) | The second event emitter object. |
|
|
35
|
-
|
|
36
|
-
#### Returns
|
|
37
|
-
|
|
38
|
-
`void`
|
|
39
|
-
|
|
40
|
-
**`Throws`**
|
|
41
|
-
|
|
42
|
-
- If either of the arguments is not an event emitter object.
|
|
43
|
-
|
|
44
|
-
#### Defined in
|
|
45
|
-
|
|
46
|
-
[src/unify.js:17](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/unify.js#L17)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / util/array-remove
|
|
2
|
-
|
|
3
|
-
# Module: util/array-remove
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](util_array_remove.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [remove](util_array_remove.md#remove)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [remove](util_array_remove.md#remove)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### remove
|
|
24
|
-
|
|
25
|
-
▸ **remove**(`...args`): `void`
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
| Name | Type |
|
|
30
|
-
| :------ | :------ |
|
|
31
|
-
| `...args` | `any` |
|
|
32
|
-
|
|
33
|
-
#### Returns
|
|
34
|
-
|
|
35
|
-
`void`
|
|
36
|
-
|
|
37
|
-
#### Defined in
|
|
38
|
-
|
|
39
|
-
[src/util/array-remove.js:5](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/util/array-remove.js#L5)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / util/object-for-each
|
|
2
|
-
|
|
3
|
-
# Module: util/object-for-each
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](util_object_for_each.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [forEach](util_object_for_each.md#foreach)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [forEach](util_object_for_each.md#foreach)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### forEach
|
|
24
|
-
|
|
25
|
-
▸ **forEach**(`obj`, `cb`, `...args`): `void`
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
| Name | Type |
|
|
30
|
-
| :------ | :------ |
|
|
31
|
-
| `obj` | `any` |
|
|
32
|
-
| `cb` | `any` |
|
|
33
|
-
| `...args` | `any` |
|
|
34
|
-
|
|
35
|
-
#### Returns
|
|
36
|
-
|
|
37
|
-
`void`
|
|
38
|
-
|
|
39
|
-
#### Defined in
|
|
40
|
-
|
|
41
|
-
[src/util/object-for-each.js:6](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/util/object-for-each.js#L6)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / util/string-pad
|
|
2
|
-
|
|
3
|
-
# Module: util/string-pad
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](util_string_pad.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [pad](util_string_pad.md#pad)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [pad](util_string_pad.md#pad)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### pad
|
|
24
|
-
|
|
25
|
-
▸ **pad**(`fill`, `...args`): `string`
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
| Name | Type |
|
|
30
|
-
| :------ | :------ |
|
|
31
|
-
| `fill` | `any` |
|
|
32
|
-
| `...args` | `any` |
|
|
33
|
-
|
|
34
|
-
#### Returns
|
|
35
|
-
|
|
36
|
-
`string`
|
|
37
|
-
|
|
38
|
-
#### Defined in
|
|
39
|
-
|
|
40
|
-
[src/util/string-pad.js:8](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/util/string-pad.js#L8)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / util/to-int
|
|
2
|
-
|
|
3
|
-
# Module: util/to-int
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](util_to_int.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [toInt](util_to_int.md#toint)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [toInt](util_to_int.md#toint)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### toInt
|
|
24
|
-
|
|
25
|
-
▸ **toInt**(`value`): `any`
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
| Name | Type |
|
|
30
|
-
| :------ | :------ |
|
|
31
|
-
| `value` | `any` |
|
|
32
|
-
|
|
33
|
-
#### Returns
|
|
34
|
-
|
|
35
|
-
`any`
|
|
36
|
-
|
|
37
|
-
#### Defined in
|
|
38
|
-
|
|
39
|
-
[src/util/to-int.js:2](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/util/to-int.js#L2)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / util/valid-callable
|
|
2
|
-
|
|
3
|
-
# Module: util/valid-callable
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](util_valid_callable.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [validCallable](util_valid_callable.md#validcallable)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [validCallable](util_valid_callable.md#validcallable)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### validCallable
|
|
24
|
-
|
|
25
|
-
▸ **validCallable**(`fn`): `any`
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
| Name | Type |
|
|
30
|
-
| :------ | :------ |
|
|
31
|
-
| `fn` | `any` |
|
|
32
|
-
|
|
33
|
-
#### Returns
|
|
34
|
-
|
|
35
|
-
`any`
|
|
36
|
-
|
|
37
|
-
#### Defined in
|
|
38
|
-
|
|
39
|
-
[src/util/valid-callable.js:1](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/util/valid-callable.js#L1)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / util/valid-object
|
|
2
|
-
|
|
3
|
-
# Module: util/valid-object
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](util_valid_object.md#default)
|
|
10
|
-
|
|
11
|
-
### Functions
|
|
12
|
-
|
|
13
|
-
- [validObject](util_valid_object.md#validobject)
|
|
14
|
-
|
|
15
|
-
## References
|
|
16
|
-
|
|
17
|
-
### default
|
|
18
|
-
|
|
19
|
-
Renames and re-exports [validObject](util_valid_object.md#validobject)
|
|
20
|
-
|
|
21
|
-
## Functions
|
|
22
|
-
|
|
23
|
-
### validObject
|
|
24
|
-
|
|
25
|
-
▸ **validObject**(`value`): `any`
|
|
26
|
-
|
|
27
|
-
#### Parameters
|
|
28
|
-
|
|
29
|
-
| Name | Type |
|
|
30
|
-
| :------ | :------ |
|
|
31
|
-
| `value` | `any` |
|
|
32
|
-
|
|
33
|
-
#### Returns
|
|
34
|
-
|
|
35
|
-
`any`
|
|
36
|
-
|
|
37
|
-
#### Defined in
|
|
38
|
-
|
|
39
|
-
[src/util/valid-object.js:3](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/util/valid-object.js#L3)
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
[events-ex](../README.md) / [Exports](../modules.md) / wrap-event-emitter
|
|
2
|
-
|
|
3
|
-
# Module: wrap-event-emitter
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### References
|
|
8
|
-
|
|
9
|
-
- [default](wrap_event_emitter.md#default)
|
|
10
|
-
|
|
11
|
-
### Variables
|
|
12
|
-
|
|
13
|
-
- [methods](wrap_event_emitter.md#methods)
|
|
14
|
-
|
|
15
|
-
### Functions
|
|
16
|
-
|
|
17
|
-
- [wrapEventEmitter](wrap_event_emitter.md#wrapeventemitter)
|
|
18
|
-
|
|
19
|
-
## References
|
|
20
|
-
|
|
21
|
-
### default
|
|
22
|
-
|
|
23
|
-
Renames and re-exports [wrapEventEmitter](wrap_event_emitter.md#wrapeventemitter)
|
|
24
|
-
|
|
25
|
-
## Variables
|
|
26
|
-
|
|
27
|
-
### methods
|
|
28
|
-
|
|
29
|
-
• `Const` **methods**: `any`
|
|
30
|
-
|
|
31
|
-
#### Defined in
|
|
32
|
-
|
|
33
|
-
[src/wrap-event-emitter.js:7](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/wrap-event-emitter.js#L7)
|
|
34
|
-
|
|
35
|
-
## Functions
|
|
36
|
-
|
|
37
|
-
### wrapEventEmitter
|
|
38
|
-
|
|
39
|
-
▸ **wrapEventEmitter**(`o?`): `any`
|
|
40
|
-
|
|
41
|
-
Create or inject the eventable instance into the object
|
|
42
|
-
|
|
43
|
-
#### Parameters
|
|
44
|
-
|
|
45
|
-
| Name | Type | Description |
|
|
46
|
-
| :------ | :------ | :------ |
|
|
47
|
-
| `o?` | `any` | the optional instance to eventable |
|
|
48
|
-
|
|
49
|
-
#### Returns
|
|
50
|
-
|
|
51
|
-
`any`
|
|
52
|
-
|
|
53
|
-
o or new Event instance
|
|
54
|
-
|
|
55
|
-
#### Defined in
|
|
56
|
-
|
|
57
|
-
[src/wrap-event-emitter.js:34](https://github.com/snowyu/events-ex.js/blob/9c254b2/src/wrap-event-emitter.js#L34)
|