Function isPropertyOf

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

    Example

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

    Type Parameters

    • Key extends PropertyKey

    Parameters

    • object: ReadOnlyRecord<Key>

      Object to check.

    Returns ((key) => boolean)

    Curried function with context set.

      • (key): boolean
      • Parameters

        • key: Key

        Returns boolean