Function hasAccessor

    • Determine if the given object has a getter & setter accessor.

      Type Parameters

      • T extends object

        Type of data.

      • K extends string | number | symbol

        Accessor key.

      Parameters

      • object: T

        An object.

      • accessor: K

        Accessor to test.

      Returns object is T & { [P in string | number | symbol]: T[P] }

      Whether the given object has the getter and setter for accessor.