MCPcopy Create free account
hub / github.com/nodejs/node / unwrapAwaitedType

Function unwrapAwaitedType

test/fixtures/snapshot/typescript.js:81348–81352  ·  view source on GitHub ↗

* For a generic `Awaited `, gets `T`.

(type)

Source from the content-addressed store, hash-verified

81346 * For a generic `Awaited<T>`, gets `T`.
81347 */
81348 function unwrapAwaitedType(type) {
81349 return type.flags & 1048576 /* TypeFlags.Union */ ? mapType(type, unwrapAwaitedType) :
81350 isAwaitedTypeInstantiation(type) ? type.aliasTypeArguments[0] :
81351 type;
81352 }
81353 function createAwaitedTypeIfNeeded(type) {
81354 // We wrap type `T` in `Awaited<T>` based on the following conditions:
81355 // - `T` is not already an `Awaited<U>`, and

Callers 5

createPromiseTypeFunction · 0.85
createPromiseLikeTypeFunction · 0.85
getReturnTypeFromBodyFunction · 0.85

Calls 2

mapTypeFunction · 0.85

Tested by

no test coverage detected