@yesstudio/yes-utils
    Preparing search index...

    Function sortKeys

    • Sorts an object's keys in lexicographic order and returns a new object with the sorted keys.

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • source: T

        The object to sort.

      Returns T

      A new object with keys sorted in lexicographic order.

      const obj = { b: 2, a: 1, c: 3 }
      sortKeys(obj)
      // => { a: 1, b: 2, c: 3 }