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

Function flattenChain

test/fixtures/snapshot/typescript.js:97458–97467  ·  view source on GitHub ↗
(chain)

Source from the content-addressed store, hash-verified

97456 }
97457 }
97458 function flattenChain(chain) {
97459 ts.Debug.assertNotNode(chain, ts.isNonNullChain);
97460 var links = [chain];
97461 while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) {
97462 chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain);
97463 ts.Debug.assertNotNode(chain, ts.isNonNullChain);
97464 links.unshift(chain);
97465 }
97466 return { expression: chain.expression, chain: links };
97467 }
97468 function visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete) {
97469 var expression = visitNonOptionalExpression(node.expression, captureThisArg, isDelete);
97470 if (ts.isSyntheticReference(expression)) {

Callers 1

visitOptionalExpressionFunction · 0.85

Calls 1

unshiftMethod · 0.80

Tested by

no test coverage detected