import { ValidationSchemas } from '~/domain'; export const hasKey = (value: T, key: K): value is T & { [KK in K]: any } => { return key in value; }; export const hasKeyMatching = ( value: any, key: K, match: (propVal: any) => boolean ): boolean => { return hasKey(value, key) && match(value[key]); };