Function flattenObjectToKeyValuesList

  • Takes an object, nested or otherwise and flattens it to list. Returns 2 arrays, 1st array contains keys in alphabetical sorted order and 2nd contains the values in the order of the keys. Both arrays have same size. Nested keys have their parent key name prefixed with a dot, eg for key lat in {location: {lat: 25.01, long: 30.02} }, it becomes location.lat

    Parameters

    • obj: object
    • flattenOptions: undefined = undefined

    Returns [string[], unknown[]]