Readability vs. maintainability: nested functions
Option 1
The nested function is not bad (depending on the situation). Of course, they bring more complexity and reduces extensibility. But in some cases, you wish to bundle some function that works with the main function output (well, it's not very different from the class).
Of course you should return object instead of the list for the usage convenience:
const myFunction = ({foo, bar}) =&gt; {
  return {
    function1() {
        return foo + bar
    },
    function2() {
        return foo * bar;
    }
  }
}
myFunction().function1()


To sum up, this design can simplify usage in some cases. However, the worst thing about this pattern is that these functions are not extendible and you can't use partial functionality (like using only function1). In most cases, I recommend avoiding this unless you are writing a library/helper function and which to simplify usage by attaching other chain function to the main output (fetch is a good example).

Option 2
Regarding the second option, it works fine as long as your function is not too complex and you don't have too many parameters. You can partially solve the issue with a lot of parameters using TypeScript (because you can statically describe them).
However, if possible I recommend changing logic a bit. Instead of requiring all parameters why don't you require the output of functions? Then you can have multiple functions which return different output + you can also write your own implementation for one part. This option opens a way for unlimited possibilities.
Example:
const myFunction = ({foo, bar}) =&gt; {
    return [
        foo,
        bar
    ]
}

myFunction({
    foo: function1(),
    bar: function1(),
})

// You can &quot;extend&quot; this function:
myFunction({
    foo: function1(),
    bar: myCustomFunction(),
})