import type { Predicate, Static } from '../types' import { isObjectLike } from '../predicates/isObjectLike' export const at = >(key: K, predicate: T) => (value: unknown): value is StaticAt => isObjectLike(value) && predicate(value[key]) type StaticAt> = Extract< Static, undefined > extends never ? { [P in K]: Static } : { [P in K]?: Static }