Type Alias IsPropTrue<TpropName, Tobject, Tdefault>

IsPropTrue<TpropName, Tobject, Tdefault>: Tobject extends Record<string, any>
    ? Tobject[TpropName] extends true
        ? true
        : Tobject[TpropName] extends false
            ? false
            : Tdefault
    : Tdefault

Returns true if TpropName on the Tobject is true, false if it is false, otherwise (if its undefined etc), it returns Tdefault (that it self defaults to false)

Type Parameters

  • TpropName extends string
  • Tobject extends any
  • Tdefault extends boolean = false