Comparing version 2.0.0-alpha.10 to 2.0.0-alpha.11
@@ -5,2 +5,9 @@ # Changelog | ||
## [2.0.0-alpha.11](https://github.com/snowyu/events-ex.js/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2024-03-27) | ||
### Features | ||
* do not remove the _events for keep reference and EventEmitter add _events after creating ([ccd8835](https://github.com/snowyu/events-ex.js/commit/ccd88358763587884cdde64be723b0655b083bc1)) | ||
## [2.0.0-alpha.10](https://github.com/snowyu/events-ex.js/compare/v2.0.0-alpha.9...v2.0.0-alpha.10) (2024-03-26) | ||
@@ -7,0 +14,0 @@ |
@@ -29,2 +29,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / [event-emitter](../modules/event_emitter-1.md) / EventEmitter | ||
[src/event-emitter.js:7](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.js#L7) | ||
[src/event-emitter.js:8](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.js#L8) |
@@ -50,3 +50,3 @@ [events-ex](../README.md) / [Exports](../modules.md) / [event-emitter](../modules/event_emitter.md) / EventEmitter | ||
[src/event-emitter.d.ts:7](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L7) | ||
[src/event-emitter.d.ts:7](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L7) | ||
@@ -76,3 +76,3 @@ ## Methods | ||
[src/event-emitter.d.ts:38](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L38) | ||
[src/event-emitter.d.ts:38](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L38) | ||
@@ -102,3 +102,3 @@ ___ | ||
[src/event-emitter.d.ts:44](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L44) | ||
[src/event-emitter.d.ts:44](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L44) | ||
@@ -127,3 +127,3 @@ ___ | ||
[src/event-emitter.d.ts:66](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L66) | ||
[src/event-emitter.d.ts:66](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L66) | ||
@@ -152,3 +152,3 @@ ___ | ||
[src/event-emitter.d.ts:59](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L59) | ||
[src/event-emitter.d.ts:59](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L59) | ||
@@ -182,3 +182,3 @@ ___ | ||
[src/event-emitter.d.ts:32](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L32) | ||
[src/event-emitter.d.ts:32](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L32) | ||
@@ -212,3 +212,3 @@ ___ | ||
[src/event-emitter.d.ts:16](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L16) | ||
[src/event-emitter.d.ts:16](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L16) | ||
@@ -242,3 +242,3 @@ ___ | ||
[src/event-emitter.d.ts:24](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L24) | ||
[src/event-emitter.d.ts:24](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L24) | ||
@@ -267,3 +267,3 @@ ___ | ||
[src/event-emitter.d.ts:51](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L51) | ||
[src/event-emitter.d.ts:51](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L51) | ||
@@ -288,3 +288,3 @@ ___ | ||
[src/event-emitter.d.ts:52](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L52) | ||
[src/event-emitter.d.ts:52](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L52) | ||
@@ -310,2 +310,2 @@ ___ | ||
[src/event-emitter.d.ts:67](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event-emitter.d.ts#L67) | ||
[src/event-emitter.d.ts:67](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event-emitter.d.ts#L67) |
@@ -52,3 +52,3 @@ [events-ex](../README.md) / [Exports](../modules.md) / [event](../modules/event.md) / Event | ||
[src/event.js:8](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L8) | ||
[src/event.js:8](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L8) | ||
@@ -65,3 +65,3 @@ ## Properties | ||
[src/event.js:38](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L38) | ||
[src/event.js:38](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L38) | ||
@@ -78,3 +78,3 @@ ___ | ||
[src/event.js:32](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L32) | ||
[src/event.js:32](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L32) | ||
@@ -91,3 +91,3 @@ ___ | ||
[src/event.js:26](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L26) | ||
[src/event.js:26](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L26) | ||
@@ -104,3 +104,3 @@ ___ | ||
[src/event.js:44](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L44) | ||
[src/event.js:44](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L44) | ||
@@ -123,3 +123,3 @@ ## Methods | ||
[src/event.js:51](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L51) | ||
[src/event.js:51](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L51) | ||
@@ -147,2 +147,2 @@ ___ | ||
[src/event.js:20](https://github.com/snowyu/events-ex.js/blob/76f449a/src/event.js#L20) | ||
[src/event.js:20](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/event.js#L20) |
@@ -44,2 +44,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / all-off | ||
[src/all-off.js:12](https://github.com/snowyu/events-ex.js/blob/76f449a/src/all-off.js#L12) | ||
[src/all-off.js:12](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/all-off.js#L12) |
@@ -28,2 +28,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / consts | ||
[src/consts.js:6](https://github.com/snowyu/events-ex.js/blob/76f449a/src/consts.js#L6) | ||
[src/consts.js:6](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/consts.js#L6) |
@@ -51,2 +51,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / default-methods | ||
[src/default-methods.js:8](https://github.com/snowyu/events-ex.js/blob/76f449a/src/default-methods.js#L8) | ||
[src/default-methods.js:8](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/default-methods.js#L8) |
@@ -40,2 +40,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / has-listeners | ||
[src/has-listeners.js:10](https://github.com/snowyu/events-ex.js/blob/76f449a/src/has-listeners.js#L10) | ||
[src/has-listeners.js:10](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/has-listeners.js#L10) |
@@ -49,2 +49,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / pipe-async | ||
[src/pipe-async.js:21](https://github.com/snowyu/events-ex.js/blob/76f449a/src/pipe-async.js#L21) | ||
[src/pipe-async.js:21](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/pipe-async.js#L21) |
@@ -49,2 +49,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / pipe | ||
[src/pipe.js:21](https://github.com/snowyu/events-ex.js/blob/76f449a/src/pipe.js#L21) | ||
[src/pipe.js:21](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/pipe.js#L21) |
@@ -46,2 +46,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / unify | ||
[src/unify.js:17](https://github.com/snowyu/events-ex.js/blob/76f449a/src/unify.js#L17) | ||
[src/unify.js:17](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/unify.js#L17) |
@@ -39,2 +39,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / util/array-remove | ||
[src/util/array-remove.js:5](https://github.com/snowyu/events-ex.js/blob/76f449a/src/util/array-remove.js#L5) | ||
[src/util/array-remove.js:5](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/util/array-remove.js#L5) |
@@ -41,2 +41,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / util/object-for-each | ||
[src/util/object-for-each.js:6](https://github.com/snowyu/events-ex.js/blob/76f449a/src/util/object-for-each.js#L6) | ||
[src/util/object-for-each.js:6](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/util/object-for-each.js#L6) |
@@ -40,2 +40,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / util/string-pad | ||
[src/util/string-pad.js:8](https://github.com/snowyu/events-ex.js/blob/76f449a/src/util/string-pad.js#L8) | ||
[src/util/string-pad.js:8](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/util/string-pad.js#L8) |
@@ -39,2 +39,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / util/to-int | ||
[src/util/to-int.js:2](https://github.com/snowyu/events-ex.js/blob/76f449a/src/util/to-int.js#L2) | ||
[src/util/to-int.js:2](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/util/to-int.js#L2) |
@@ -39,2 +39,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / util/valid-callable | ||
[src/util/valid-callable.js:1](https://github.com/snowyu/events-ex.js/blob/76f449a/src/util/valid-callable.js#L1) | ||
[src/util/valid-callable.js:1](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/util/valid-callable.js#L1) |
@@ -39,2 +39,2 @@ [events-ex](../README.md) / [Exports](../modules.md) / util/valid-object | ||
[src/util/valid-object.js:3](https://github.com/snowyu/events-ex.js/blob/76f449a/src/util/valid-object.js#L3) | ||
[src/util/valid-object.js:3](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/util/valid-object.js#L3) |
@@ -33,3 +33,3 @@ [events-ex](../README.md) / [Exports](../modules.md) / wrap-event-emitter | ||
[src/wrap-event-emitter.js:6](https://github.com/snowyu/events-ex.js/blob/76f449a/src/wrap-event-emitter.js#L6) | ||
[src/wrap-event-emitter.js:7](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/wrap-event-emitter.js#L7) | ||
@@ -58,2 +58,2 @@ ## Functions | ||
[src/wrap-event-emitter.js:33](https://github.com/snowyu/events-ex.js/blob/76f449a/src/wrap-event-emitter.js#L33) | ||
[src/wrap-event-emitter.js:34](https://github.com/snowyu/events-ex.js/blob/ccd8835/src/wrap-event-emitter.js#L34) |
@@ -268,3 +268,4 @@ "use strict"; | ||
if (type == null) { | ||
delete this._events; | ||
// delete this._events | ||
Object.keys(data).forEach(key => delete data[key]); | ||
} else { | ||
@@ -284,3 +285,4 @@ delete data[type]; | ||
this.removeAllListeners('removeListener'); | ||
delete this._events; | ||
// delete this._events | ||
Object.keys(data).forEach(key => delete data[key]); | ||
return this; | ||
@@ -287,0 +289,0 @@ } |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.default = void 0; | ||
var _utilEx = require("util-ex"); | ||
var _eventable = require("./eventable"); | ||
@@ -14,4 +15,6 @@ /** | ||
*/ | ||
function EventEmitter() {} | ||
function EventEmitter() { | ||
(0, _utilEx.defineProperty)(this, '_events', {}); | ||
} | ||
(0, _eventable.eventable)(EventEmitter); | ||
var _default = exports.default = EventEmitter; |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.wrapEventEmitter = wrapEventEmitter; | ||
var _utilEx = require("util-ex"); | ||
var _eventable = _interopRequireDefault(require("./eventable")); | ||
@@ -39,9 +40,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function wrapEventEmitter(o) { | ||
if (o == null) { | ||
return create(base); | ||
} else { | ||
return defineProperties(Object(o), descriptors); | ||
} | ||
const result = o == null ? create(base) : defineProperties(Object(o), descriptors); | ||
(0, _utilEx.defineProperty)(result, '_events', {}); | ||
return result; | ||
} | ||
; | ||
var _default = exports.default = wrapEventEmitter; |
{ | ||
"name": "events-ex", | ||
"version": "2.0.0-alpha.10", | ||
"version": "2.0.0-alpha.11", | ||
"description": "Browser-friendly enhanced events most compatible with standard node.js, it's powerful eventable ability.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -241,3 +241,4 @@ import {defineProperty, isArray, isFunction, isNumber, isObject, isUndefined} from 'util-ex' | ||
if (type == null){ | ||
delete this._events | ||
// delete this._events | ||
Object.keys(data).forEach(key => delete data[key]) | ||
} else { | ||
@@ -255,3 +256,4 @@ delete data[type] | ||
this.removeAllListeners('removeListener') | ||
delete this._events | ||
// delete this._events | ||
Object.keys(data).forEach(key => delete data[key]) | ||
return this | ||
@@ -258,0 +260,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import {defineProperty} from 'util-ex' | ||
import {eventable} from './eventable' | ||
@@ -7,3 +8,3 @@ | ||
*/ | ||
export function EventEmitter() {} | ||
export function EventEmitter() {defineProperty(this, '_events', {})} | ||
@@ -10,0 +11,0 @@ eventable(EventEmitter); |
@@ -0,1 +1,2 @@ | ||
import {defineProperty} from 'util-ex' | ||
import eventable from './eventable' | ||
@@ -34,7 +35,5 @@ | ||
export function wrapEventEmitter(o) { | ||
if (o == null) { | ||
return create(base); | ||
} else { | ||
return defineProperties(Object(o), descriptors); | ||
} | ||
const result = o == null ? create(base) : defineProperties(Object(o), descriptors) | ||
defineProperty(result, '_events', {}) | ||
return result | ||
}; | ||
@@ -41,0 +40,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139428
100
2179