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

Function addConvertToAsyncFunctionDiagnostics

test/fixtures/snapshot/typescript.js:144790–144795  ·  view source on GitHub ↗
(node, checker, diags)

Source from the content-addressed store, hash-verified

144788 }
144789 }
144790 function addConvertToAsyncFunctionDiagnostics(node, checker, diags) {
144791 // need to check function before checking map so that deeper levels of nested callbacks are checked
144792 if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) {
144793 diags.push(ts.createDiagnosticForNode(!node.name && ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name) ? node.parent.name : node, ts.Diagnostics.This_may_be_converted_to_an_async_function));
144794 }
144795 }
144796 function isConvertibleFunction(node, checker) {
144797 return !ts.isAsyncFunction(node) &&
144798 node.body &&

Callers 1

checkFunction · 0.85

Calls 4

isConvertibleFunctionFunction · 0.85
getKeyFromNodeFunction · 0.85
hasMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…