Attempting to pass string[] to paths() won't compile using tyepscript
ja11sop opened this issue · 0 comments
ja11sop commented
From the documentation I expected this to work
const searchPaths = ["/tmp","/etc"];
const allFiles = FileHound.create()
.paths(searchPaths)
.findSync();
But instead I get this error:
Argument of type 'string[]' is not assignable to parameter of type 'string'.
I must instead use the spread operator:
const searchPaths = ["/tmp","/etc"];
const allFiles = FileHound.create()
.paths(...searchPaths)
.findSync();
(1) Is this intentional?
(2) If yes it would help to update the documentation to reflect this.