Skip to content

Commit

Permalink
fix(esl-event-listener): fix typechecking for TS5
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Mar 27, 2023
1 parent 4f6516e commit d434275
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/esl-event-listener/core/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ESLEventListener implements ESLListenerDefinition, EventListenerObj
const target = resolveProperty(this.target, this.host);
if (isObject(target)) return wrap(target);
const $host = '$host' in this.host ? this.host.$host : this.host;
if (typeof target === 'string') return ESLTraversingQuery.all(target, $host);
if (typeof target === 'string') return ESLTraversingQuery.all(target, $host as any);
if (typeof target === 'undefined' && $host instanceof HTMLElement) return [$host];
return [];
}
Expand Down Expand Up @@ -153,8 +153,8 @@ export class ESLEventListener implements ESLListenerDefinition, EventListenerObj
/** Adds listener to the listener store of the host object */
protected static add(host: object, instance: ESLEventListener): void {
if (!isObject(host)) return;
if (!Object.hasOwnProperty.call(host, LISTENERS)) host[LISTENERS] = [];
host[LISTENERS].push(instance);
if (!Object.hasOwnProperty.call(host, LISTENERS)) (host as any)[LISTENERS] = [];
(host as any)[LISTENERS].push(instance);
}
/** Removes listener from the listener store of the host object */
protected static remove(host: object, instance: ESLEventListener): void {
Expand Down

0 comments on commit d434275

Please sign in to comment.