From 068d6b4998d224d321796f06dd66403f3520e5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 16 Sep 2026 21:46:00 +0000 Subject: [PATCH] :recycle: Use line comments in primitive matchers Replace the three `/* */` prose blocks with `//` line comments, matching the rest of the codebase and the comment style the oxlint config now allows. --- src/primitive.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/primitive.ts b/src/primitive.ts index 6759784..5046949 100644 --- a/src/primitive.ts +++ b/src/primitive.ts @@ -19,10 +19,8 @@ export const getPrimitiveUnionMatcherW: () => < >( pattern: Simplify

, ) => UnaryFn> = () => (pattern) => (shape) => - /* - Rewrite not to use any is possible, was evaluated and solutions were - more complex than the current solution. - */ + // Rewrite not to use any is possible, was evaluated and solutions were + // more complex than the current solution. // oxlint-disable-next-line typescript/no-explicit-any typescript/no-unsafe-type-assertion (pattern[shape] as any)(shape); @@ -50,10 +48,8 @@ export const getPrimitiveUnionMatcherPartial: () => < >( pattern: Simplify>, ) => UnaryFn = () => (pattern) => (shape) => - /* - Rewrite not to use any is possible, was evaluated and solutions were - more complex than the current solution. - */ + // Rewrite not to use any is possible, was evaluated and solutions were + // more complex than the current solution. // oxlint-disable-next-line typescript/no-explicit-any typescript/no-unsafe-type-assertion (pattern[shape] ?? (pattern as any)["_"])(shape); @@ -65,13 +61,11 @@ export const getPrimitiveUnionMatcherPartial: () => < export const getPrimitiveUnionMatcherPartialW: < T extends string | number, >() =>

>( - /* - `Simplify

` is the inference hook: callers infer `P` from the argument. - the second half pins the impl parameter's `R` to `PatternReturns

`. - that makes the `= getPrimitiveUnionMatcherPartial` assignment type-check. - neither half works alone. - without the witness the union's `_` arm demands `_ ∈ keyof P`. - without `Simplify

` the parameter types do not compare. - */ + // `Simplify

` is the inference hook: callers infer `P` from the argument. + // the second half pins the impl parameter's `R` to `PatternReturns

`. + // that makes the `= getPrimitiveUnionMatcherPartial` assignment type-check. + // neither half works alone. + // without the witness the union's `_` arm demands `_ ∈ keyof P`. + // without `Simplify

` the parameter types do not compare. pattern: Simplify

& PatternPrimitiveUnionPartial, T>, ) => UnaryFn> = getPrimitiveUnionMatcherPartial;