Function isPropertyOf

  • Check if the given key is present in the given object (not inherited).

    Example

    const isPropertyOfFoo = isPropertyOf({ "🟢": "🟩" });
    isPropertyOfFoo("🟢"); // true
    isPropertyOfFoo("🟩"); // false

    Returns

    Curried function with context set.

    Type Parameters

    • Key extends PropertyKey

    Parameters

    • object: Readonly<Record<Key, unknown>>

      Object to check.

    Returns ((key: Key) => boolean)

      • (key: Key): boolean
      • Parameters

        • key: Key

        Returns boolean