Skip to content

Commit

Permalink
Typeof function check fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuznietsov committed Jun 22, 2021
1 parent 8613a24 commit fb655d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/expressions/common/expression_renderers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ export class DefaultInterpreterRenderHandlers<Emitters = {}> implements IInterpr
const eventName = event as keyof this;
if (this[eventName]) {
const eventCall = this[eventName];
if (!eventCall || typeof eventCall !== 'function') return;
if (typeof eventCall !== 'function') return;

const updatedEvent = (...args: unknown[]) => {
const preventFromCallingListener: void | boolean = eventCall(...args);
if (fn && typeof fn === 'function' && !preventFromCallingListener) {
if (typeof fn === 'function' && !preventFromCallingListener) {
fn(...args);
}
return preventFromCallingListener;
Expand Down

0 comments on commit fb655d0

Please sign in to comment.