♻️ Share the Matchable universe between both matchers

This commit is contained in:
tmu committed 2026-09-22 10:54:27 +00:00
1 parent d88a4eeb45
commit 6228b4922d
4 files changed
+24 -17

No files matched your search

+1 -4
View File
@@ -2,6 +2,7 @@ import type { Exact } from "type-fest";
import type {
HandlerMap,
Matchable,
PatternKey,
PatternParam,
PatternReturns,
@@ -9,10 +10,6 @@ import type {
UnaryFn,
} from "./matcher-shared.ts";
// The primitive universe a matcher can discriminate. `boolean` is admitted as
// the pair `true | false`; see README § Caveats for the unsupported members.
type Matchable = string | number | boolean | null | undefined;
type Handlers<T extends Matchable, R> = {
[K in PatternKey<T>]: UnaryFn<PatternParam<K>, R>;
};