diff --git a/src/patterns.ts b/src/patterns.ts index 9f04b2e..0daa17d 100644 --- a/src/patterns.ts +++ b/src/patterns.ts @@ -107,8 +107,9 @@ export type infer = InvertPattern, unknown>; * type Narrowed = P.narrow * // ^? ['a', 'a' | 'b'] */ -export type narrow> = NoInfer< - ExtractPreciseValue> +export type narrow> = ExtractPreciseValue< + input, + InvertPattern >; function chainable>( diff --git a/src/types/FindSelected.ts b/src/types/FindSelected.ts index 6760355..c2ac5b9 100644 --- a/src/types/FindSelected.ts +++ b/src/types/FindSelected.ts @@ -166,4 +166,4 @@ export type FindSelected = // This happens if the provided pattern didn't extend Pattern, // Because the type checker falls back on the general `Pattern` type // in this case. - NoInfer> extends true ? i : Selections>; + Equal> extends true ? i : Selections;