UNPKG

shapeit

Version:

Object validation tools for Javascript and, specially, Typescript

6 lines (5 loc) 281 B
import { ShapeGuard, GuardType } from '../types/guards'; /** * Creates a shape guard from an original shape by picking a set of its keys. */ export default function pick<T extends ShapeGuard, K extends keyof GuardType<T>>(guard: T, keys: K[]): ShapeGuard<Pick<GuardType<T>, K>>;