Preparing search index...
    • Checks if an object has at least the specified keys

      Type Parameters

      • T

      Parameters

      • val: unknown

        The value to check

      • keys: (keyof T)[]

        Array of required keys

      Returns boolean

      True if the object has at least all specified keys (extra keys are allowed)

      hasAtLeastKeys({a: 1, b: 2}, ["a", "b"]) // true
      hasAtLeastKeys({a: 1, b: 2, c: 3}, ["a", "b"]) // true (extra key allowed)
      hasAtLeastKeys({a: 1}, ["a", "b"]) // false (missing key)