MCPcopy Index your code
hub / github.com/nodejs/node / getIterationTypesOfIterableSlow

Function getIterationTypesOfIterableSlow

test/fixtures/snapshot/typescript.js:83347–83361  ·  view source on GitHub ↗

* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like * type from its members. * * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` * record is returned. Otherwise, `noIterationTypes` is r

(type, resolver, errorNode)

Source from the content-addressed store, hash-verified

83345 * `getIterationTypesOfIterable` instead.
83346 */
83347 function getIterationTypesOfIterableSlow(type, resolver, errorNode) {
83348 var _a;
83349 var method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName));
83350 var methodType = method && !(method.flags & 16777216 /* SymbolFlags.Optional */) ? getTypeOfSymbol(method) : undefined;
83351 if (isTypeAny(methodType)) {
83352 return setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);
83353 }
83354 var signatures = methodType ? getSignaturesOfType(methodType, 0 /* SignatureKind.Call */) : undefined;
83355 if (!ts.some(signatures)) {
83356 return setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
83357 }
83358 var iteratorType = getIntersectionType(ts.map(signatures, getReturnTypeOfSignature));
83359 var iterationTypes = (_a = getIterationTypesOfIterator(iteratorType, resolver, errorNode)) !== null && _a !== void 0 ? _a : noIterationTypes;
83360 return setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
83361 }
83362 function reportTypeNotIterableError(errorNode, type, allowAsyncIterables) {
83363 var message = allowAsyncIterables
83364 ? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator

Calls 10

getPropertyOfTypeFunction · 0.85
getTypeOfSymbolFunction · 0.85
isTypeAnyFunction · 0.85
setCachedIterationTypesFunction · 0.85
getSignaturesOfTypeFunction · 0.85
getIntersectionTypeFunction · 0.85
someMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…