Library API
    Preparing search index...

    Function hasAnyOf

    • Asserts whether an object has at least one of the specified keys (using the in operator, unwrapping Proxies if present). Safe against null, undefined, and non-object primitives.

      Type Parameters

      • K extends readonly PropertyKey[]

      Parameters

      • obj: unknown

        The target object to inspect

      • ...keys: K

        Candidate property keys to verify, including inherited properties

      Returns obj is { [P in PropertyKey]: Record<P, unknown> }[K[number]]

      True if the target contains at least one of the specified keys; false if no keys are provided or obj is not an object

      Errors from proxy traps or getters used while unwrapping or checking keys propagate to the caller.

      if (hasAnyOf(arg, 'install', 'define')) { ... }