Closed OmgImAlexis closed 3 years ago
Hi, no the type
function specifies a type for each individual value, by design..
In your case, if you start with this..
const options = commandLineArgs(..)
.. and options.file
contains an array of FileDetails
instances then you could pass them into a FileList
class..
class FileList {
constructor (files) {
this.files = files
this.exists = files.every(f => f.exists)
}
}
const fileList = new FileList(options.file)
Unfortunately in my case that won’t work as it’s not files; I was just using that as an example.
I’ll have to just use strings and combine then after the fact.
Is it possible to have multiple values returned as a single custom type?
For example the wiki shows this.
Whereas I'm wanting this.