Skip to content

StrictOmit

Overview

Type StrictOmit

Just like Omit, except it enforces the presence of omitted keys in the original type. i.e.: type X = { hello: number; hola: boolean; }; type Y1 = Omit<X, 'goodbye'>; // Wouldn't throw an error type Y2 = StrictOmit<X, 'goodbye'>; // Will throw an error

@author Michael Kauzmann (PhET Interactive Simulations) @author Agustín Vallejo (PhET Interactive Simulations)

import type { StrictOmit } from 'scenerystack/phet-core';

Pick<ObjectType, Exclude<keyof ObjectType, KeysType>>

Source Code

See the source for StrictOmit.ts in the phet-core repository.