jackbsteinberg / get-originals-rewriter

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Code cleanup: type-taking helpers #68

Open domenic opened 5 years ago

domenic commented 5 years ago

Currently we have a couple helpers which change their behavior depending on the type of construct:

These are generally inconsistent in what parameters they take, and in what order. Furthermore, in some cases some of the parameters are unused, e.g. the 'constructor' type requires much less information than others.

We should change all of these (or at least most?) to have a signature like (type, ... any other information that doesn't depend on type ..., options), where options contains the relevant type-specific information. For example, getOriginal(type, { name, module }) is nice, because for type = 'constructor', you don't need module. (This might also be an opportunity to improve the naming of the arguments... e.g. name of what?)