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

Function getInvalidTextualChildDiagnostic

test/fixtures/snapshot/typescript.js:64206–64216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64204 }
64205 return result;
64206 function getInvalidTextualChildDiagnostic() {
64207 if (!invalidTextDiagnostic) {
64208 var tagNameText = ts.getTextOfNode(node.parent.tagName);
64209 var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
64210 var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName);
64211 var childrenTargetType = getIndexedAccessType(target, getStringLiteralType(childrenPropName));
64212 var diagnostic = ts.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;
64213 invalidTextDiagnostic = __assign(__assign({}, diagnostic), { key: "!!ALREADY FORMATTED!!", message: ts.formatMessage(/*_dummy*/ undefined, diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) });
64214 }
64215 return invalidTextDiagnostic;
64216 }
64217 }
64218 function generateLimitedTupleElements(node, target) {
64219 var len, i, elem, nameType;

Callers

nothing calls this directly

Calls 5

getJsxNamespaceAtFunction · 0.85
getIndexedAccessTypeFunction · 0.85
getStringLiteralTypeFunction · 0.85
typeToStringFunction · 0.85

Tested by

no test coverage detected