♻️ Adopt the three-overload matcher
strict/widened each take the exhaustive/fallback pattern shape in three overloads ordered ExhaustiveLoose -> Fallback -> Handlers. TypeScript reads the first overload for the object-literal popup (_?, a, b) and the last for the missing-key error, so autocomplete and the error message are tuned independently. The fallback is a pattern shape, not a factory, so the four getPrimitiveUnionMatcher* factories collapse to two. src/index.ts re-exports the two factories; the prototype scratch files that explored the alternatives are removed.
This commit is contained in:
1 parent
02634f41de
commit
165bd9e3df
3 files changed
+373
-270
No files matched your search
+1
-6
@@ -1,6 +1 @@
|
||||
export {
|
||||
getPrimitiveUnionMatcher,
|
||||
getPrimitiveUnionMatcherPartial,
|
||||
getPrimitiveUnionMatcherPartialW,
|
||||
getPrimitiveUnionMatcherW,
|
||||
} from "./primitive.ts";
|
||||
export { strict, widened } from "./primitive.ts";
|
||||
Reference in new issue
Block a user