@unified-latex/unified-latex-util-visit
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -16,3 +16,3 @@ import * as Ast from "@unified-latex/unified-latex-types"; | ||
}; | ||
type GetGuard<T> = T extends (x: any) => x is infer R ? R : never; | ||
type GetGuard<T> = T extends (x: any, ...y: any[]) => x is infer R ? R : never; | ||
/** | ||
@@ -22,3 +22,3 @@ * Gets the type that a type-guard function is guarding. If | ||
*/ | ||
type GuardTypeOf<T extends (x: any) => boolean> = GetGuard<T> extends never ? T extends (x: infer A) => any ? A : never : GetGuard<T>; | ||
type GuardTypeOf<T extends (x: any, ...y: any[]) => boolean> = GetGuard<T> extends never ? T extends (x: infer A) => any ? A : never : GetGuard<T>; | ||
/** | ||
@@ -30,3 +30,3 @@ * Extracts the guard type from the `test` function provided in a | ||
test: infer R; | ||
} ? R extends (x: any) => boolean ? Extract<PossibleTypes, GuardTypeOf<R>> : PossibleTypes : PossibleTypes; | ||
} ? R extends (x: any, ...y: any[]) => boolean ? Extract<PossibleTypes, GuardTypeOf<R>> : PossibleTypes : PossibleTypes; | ||
/** | ||
@@ -33,0 +33,0 @@ * Narrow the type `T` based on the `VisitOptions` supplied. If `{includeArrays: false}` |
{ | ||
"name": "@unified-latex/unified-latex-util-visit", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Functions for traversing a unified-latex AST", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53786