SubOptionalOrFalse<T>: {
    [P in keyof T]?: OptionalOrFalse<T[P]>
}

use OptionalOrFalse on all keys

Type Parameters

  • T

    the Record where all sub keys can be falsifiable

Example

type myType = {
foo: {
foo: string;
bar: string;
}
}

type myFalsifiableType = SubOptionalOrFalse<myType>;
/**
myFalsifiableType = {
foo: {
foo?: string | false;
bar?: string | false;
}
}