TypeStat
TypeStat copied to clipboard
Consider sanitizing the options object early on before passing it around
Talked a bit about architecture with @ian-craig. Some good feedback:
Random feedback: It might be worth sanitizing the options object early on before you pass it around. e.g. collectFileMutators is basically a "getValueOrDefault" for the mutators list, but is called quite deep in the program. If the defaults were applied at top level all these lower-level functions wouldn't have to worry about what is and isn't set.
Same goes for the [invalid --fileNames names] error case you were talking about. Maybe the fileNames from options should be sanitized at the beginning so you can report an error cleanly and other functions don't have to worry