I have created a typescript util that return true if the parameter is a function and false if not, but when I use it to discriminate the way that I use a variable, typescript doesn't recognize the check.
util:
export function isFunction<T>(value: T | undefined): boolean {
return typeof value === 'function';
}
usage
isFunction(group) ? group(el) : group
isFunctionis not caught by compiler ?