Comparing version 3.15.0 to 3.16.0
@@ -0,1 +1,7 @@ | ||
# 3.16.0 | ||
**Features:** | ||
* added `getIteratorYieldResultFromIteratorResult` to extract the `yield`ed type from `IteratorResult<TYield, TReturn, TNext>` | ||
# 3.15.0 | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "tsutils", | ||
"version": "3.15.0", | ||
"version": "3.16.0", | ||
"description": "utilities for working with typescript's AST", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -21,1 +21,2 @@ import * as ts from 'typescript'; | ||
export declare function getInstanceTypeOfClassLikeDeclaration(node: ts.ClassLikeDeclaration, checker: ts.TypeChecker): ts.Type; | ||
export declare function getIteratorYieldResultFromIteratorResult(type: ts.Type, node: ts.Node, checker: ts.TypeChecker): ts.Type; |
@@ -231,1 +231,9 @@ "use strict"; | ||
exports.getInstanceTypeOfClassLikeDeclaration = getInstanceTypeOfClassLikeDeclaration; | ||
function getIteratorYieldResultFromIteratorResult(type, node, checker) { | ||
return type_1.isUnionType(type) && type.types.find((t) => { | ||
const done = t.getProperty('done'); | ||
return done !== undefined && | ||
isBooleanLiteralType(removeOptionalityFromType(checker, checker.getTypeOfSymbolAtLocation(done, node)), false); | ||
}) || type; | ||
} | ||
exports.getIteratorYieldResultFromIteratorResult = getIteratorYieldResultFromIteratorResult; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
192832
3879