@lightningtv/core
Advanced tools
Comparing version 2.4.4 to 2.4.5
import { Config } from './config.js'; | ||
import { isFunction } from './utils.js'; | ||
const keyMapEntries = { | ||
@@ -110,3 +111,4 @@ ArrowLeft: 'Left', | ||
const onKeyHandler = elm[`on${mappedEvent}`]; | ||
if (onKeyHandler?.call(elm, e, elm, finalFocusElm) === true) { | ||
if (isFunction(onKeyHandler) && | ||
onKeyHandler.call(elm, e, elm, finalFocusElm) === true) { | ||
break; | ||
@@ -119,3 +121,4 @@ } | ||
const fallbackFunction = isHold ? elm.onKeyHold : elm.onKeyPress; | ||
if (fallbackFunction?.call(elm, e, mappedEvent, elm, finalFocusElm) === true) { | ||
if (isFunction(fallbackFunction) && | ||
fallbackFunction.call(elm, e, mappedEvent, elm, finalFocusElm) === true) { | ||
break; | ||
@@ -122,0 +125,0 @@ } |
@@ -6,2 +6,3 @@ import { INode } from '@lightningjs/renderer'; | ||
export declare const isFunc: (obj: unknown) => obj is CallableFunction; | ||
export declare const isFunction: (obj: unknown) => obj is Function; | ||
export declare function isObject(item: unknown): item is Record<string | number | symbol, unknown>; | ||
@@ -8,0 +9,0 @@ export declare function isArray(item: unknown): item is any[]; |
@@ -15,2 +15,3 @@ import { Config, isDev } from './config.js'; | ||
export const isFunc = (obj) => obj instanceof Function; | ||
export const isFunction = (obj) => typeof obj === 'function'; | ||
export function isObject(item) { | ||
@@ -17,0 +18,0 @@ return typeof item === 'object'; |
{ | ||
"name": "@lightningtv/core", | ||
"version": "2.4.4", | ||
"version": "2.4.5", | ||
"description": "Lightning TV Core for Universal Renderers", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -11,2 +11,3 @@ import { Config } from './config.js'; | ||
} from './focusKeyTypes.js'; | ||
import { isFunction } from './utils.js'; | ||
@@ -149,4 +150,7 @@ declare module '@lightningtv/core' { | ||
if (mappedEvent) { | ||
const onKeyHandler = elm[`on${mappedEvent}`] as KeyHandler; | ||
if (onKeyHandler?.call(elm, e, elm, finalFocusElm) === true) { | ||
const onKeyHandler = elm[`on${mappedEvent}`]; | ||
if ( | ||
isFunction(onKeyHandler) && | ||
onKeyHandler.call(elm, e, elm, finalFocusElm) === true | ||
) { | ||
break; | ||
@@ -159,3 +163,4 @@ } | ||
if ( | ||
fallbackFunction?.call(elm, e, mappedEvent, elm, finalFocusElm) === true | ||
isFunction(fallbackFunction) && | ||
fallbackFunction.call(elm, e, mappedEvent, elm, finalFocusElm) === true | ||
) { | ||
@@ -162,0 +167,0 @@ break; |
@@ -26,2 +26,5 @@ import { INode } from '@lightningjs/renderer'; | ||
export const isFunction = (obj: unknown): obj is Function => | ||
typeof obj === 'function'; | ||
export function isObject( | ||
@@ -28,0 +31,0 @@ item: unknown, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
225418
3471