Function isTypeObject

  • A Type Guard to check if given value type is equal to "object"

    If you don't want to allow null, which is also considered a object type, use isRecord or isObject instead.

    Example

    import { isTypeObject, isNull } from 'type-guard-helpers'
    const test = {} as unknown;
    if (isTypeObject(test) && test !== null) {
    test[1];
    test.test;
    }
    // equivalent to `isObject`

    Type Parameters

    • Value extends unknown

    • Result extends null | {} = null | {}

    Parameters

    • value: Value

    Returns value is Combine<Value, Result>

Generated using TypeDoc