• Checks if path is a direct property of object.

    This function checks whether the specified property exists directly on the object (not inherited from its prototype chain).

    Parameters

    • obj: Record<string, unknown>

      The object to query.

    • path: string

      The path to check.

    Returns boolean

    Returns true if path exists, else false.

    import { has } from './AcCmLodashUtils'

    const object = { a: 1, b: 2 }
    has(object, 'a') // true
    has(object, 'c') // false
    has(object, 'toString') // false (inherited property)