guardz
Version:
A simple and lightweight TypeScript type guard library for runtime type validation.
10 lines (9 loc) • 481 B
TypeScript
import type { TypeGuardFn } from './isType';
/**
* Creates a type guard that checks an object omits the specified keys.
*
* - Composed with a base object type guard (e.g., from `isType`/`isSchema`).
* - Validation of remaining properties stays with the base guard; this only
* enforces that the omitted keys are not present on the object.
*/
export declare function isOmit<T, K extends keyof T>(baseTypeGuard: TypeGuardFn<T>, ...omittedKeys: K[]): TypeGuardFn<Omit<T, K>>;