Just so that we’re speaking the same language, please read this post describing three types of functions. mkdir
returns a Promise
, which you’re ignoring. That’s totally a cool thing to do as long as you’re writing “type A” functions, where nobody cares when it does the work. However, you do seem to care when it finishes, which means that you need to pay attention to the return value from mkdir
and propagate it appropriately. Explicitly declaring types for the return value of every function I write helps me personally here as well. A casual reader (and your toolchain) can’t know by instant inspection whether makePrivateDirectory
is going to tell us anything about when it’s finished.
1 Like