Sorts two objects based on their keys' positions in an array of keys.

  • Parameters

    • keys: string[]

      An array of keys to sort the objects by.

    Returns ((a: Record<string, unknown>, b: Record<string, unknown>) => number)

    A number indicating the sort order of the two objects.

      • (a, b): number
      • Parameters

        • a: Record<string, unknown>
        • b: Record<string, unknown>

        Returns number