Skip to content

Commit

Permalink
fix(f.narrow): preserve functions
Browse files Browse the repository at this point in the history
  • Loading branch information
millsp committed Mar 4, 2021
1 parent e28bddf commit c34f1b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sources/Function/Narrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import {Narrowable} from './_Internal'
* @hidden
*/
type NarrowRaw<A> =
| A
| (A extends Narrowable ? A : never)
| ({[K in keyof A]: NarrowRaw<A[K]>})
| (A extends Narrowable ? A : never)
| {[K in keyof A]: A[K] extends Function
? A[K]
: NarrowRaw<A[K]>}

/**
* Prevent type widening on generic function parameters
Expand Down

0 comments on commit c34f1b9

Please sign in to comment.