Skip to content

WithoutNull

Overview

Converts either an entire object (or a subset of keys of it) into non-null forms.

type T = { a: number | null; b: string | number[] | null; c: { x: number; }; }; type X = WithoutNull<T>; // { a: number, b: string | number[], c: { x: 5 } } type Y = WithoutNull<T, 'a'>; // { a: number, b: string | number[] | null, c: { x: 5 } }

@author Jonathan Olson <jonathan.olson@colorado.edu>

Type WithoutNull

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

T & { [key in keys]: NotNull<T[ key ]> }

Source Code

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