@tspro/ts-utils-lib
    Preparing search index...

    Function hasProperties

    • // Gives type Record<string, unknown>
      hasProperties(obj, ["a", "b"]);

      // Gives type Record<"a" | "b", unknown>
      hasProperties(obj, ["a", "b"] as const);

      Type Parameters

      • T extends readonly string[]

      Parameters

      • obj: unknown
      • props: string[] | T

      Returns obj is Record<T[number], unknown>