Closed kukeiko closed 2 years ago
the binary criteria (except is-odd/is-even) have been simplified to be in-value / not-value. in-number-set, in-string-set, not-in-number-set and not-in-string-set are now just in-set / not-in-set.
I am not yet totally convinced that we need to keep the value types within the criteria, but for now it's fine.
also, I've removed a lot of barrel files in favor of a single index.ts at package root that exports all publicly available files. helps with treeshaking (even though that is not a major concern right now), but it also helpse with moving files around easier, as the automatic update of imports will now go directly to the file, instead of some barrel file now exporting from a parent/sibling folder.
the main reason why I started doing this is because auto-import is extremely overzealous now, and favors importing from barrel files over anything else, which is quite annoying. now it is better, but will be properly fixed once typescript issue 45953 is fixed.
edit: I accidentally created a issue mention to the typescript issue. whoopsiedaisy
What
Take the following criteria:
and see if we can simplify them.
Why
Right now it feels like it is a bit bloated and over-engineered.
Notes
I did create separate classes so that the user could target those criteria for remapping. If we "collapse" them all into the is-value & not-value criteria, then we need a way to narrow them down by value type, e.g. "remap to is-value: boolean". Because of that it makes sense looking into #119 to properly test inferred types.