refactor(context-zone-peer-dep): fix eslint warnings (#5371)
This commit is contained in:
parent
7a1e1b274f
commit
c27fbc6d49
|
|
@ -15,13 +15,17 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* check if an object has addEventListener and removeEventListener functions then it will return true.
|
||||
* Generally only called with a `TargetWithEvents` but may be called with an unknown / any.
|
||||
* check if an object has `addEventListener` and `removeEventListener` functions.
|
||||
* Generally only called with a `TargetWithEvents` but may be called with an `unknown` value.
|
||||
* @param obj - The object to check.
|
||||
*/
|
||||
export function isListenerObject(obj: any = {}): boolean {
|
||||
export function isListenerObject(obj: unknown): boolean {
|
||||
return (
|
||||
typeof obj === 'object' &&
|
||||
obj !== null &&
|
||||
'addEventListener' in obj &&
|
||||
typeof obj.addEventListener === 'function' &&
|
||||
'removeEventListener' in obj &&
|
||||
typeof obj.removeEventListener === 'function'
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue