Function hasKey

  • Example

    import * as P from "flurp/pojo";

    const hasX = P.hasKey("x");
    hasX({x: 5}); // true
    hasX({y: 2}); // false

    Type Parameters

    • T extends Readonly<Record<string, unknown>>

    Parameters

    • key: string

    Returns ((obj: T) => boolean)

      • (obj: T): boolean
      • Parameters

        • obj: T

        Returns boolean