vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Function sortProperties

    • Deep sort the properties of an object by their key name and return a new object with the sorted properties.

      Parameters

      • obj: unknown

        Object to sort

      • OptionalcompareFn: (a: [key: string, value: unknown], b: [key: string, value: unknown]) => number

        Optional compare function to use when sorting the properties; defaults to a.localeCompare(b, 'en')

      • Optionaloptions: { sortOrder?: "asc" | "desc" }

        Optional options to control the sort order; defaults to asc

      Returns any

      New object with the sorted properties