Function has

  • Checks if key is a direct property of object.

    Type Parameters

    • T extends {}
    • U extends PropertyName

    Parameters

    • object: T
    • key: U

    Returns object is T & _Record<U, unknown>

    0.1.0

    hasIn, hasPath, hasPathIn

    const object = { 'a': { 'b': 2 } }
    const other = create({ 'a': create({ 'b': 2 }) })

    has(object, 'a')
    // => true

    has(other, 'a')
    // => false