@alextheman/utility - v5.34.0
    Preparing search index...

    Function containsKeys

    • Determines if the given input is a non-nullable object, and if that object contains all of the keys provided.

      Type Parameters

      • Key extends PropertyKey = string

      Parameters

      • input: unknown

        The input to check.

      • keys: Key | readonly Key[]

        The keys expected to be in the input if it's an object.

      Returns input is Record<Key, unknown>

      true if the input is an object containing all provided keys, and false otherwise. The input type will also be narrowed down to be a record with the provided keys, each with an unknown value type.