shapeit
Version:
Object validation tools for Javascript and, specially, Typescript
9 lines (8 loc) • 326 B
TypeScript
import { ShapeGuard, GuardType } from '../types/guards';
/**
* Creates a shape where all object keys are optional.
*
* This is NOT valid for nested keys inside objects. If you really need it, use
* deepPartial instead
*/
export default function partial<T extends ShapeGuard>(guard: T): ShapeGuard<Partial<GuardType<T>>>;