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

Function checkJsxChildren

test/fixtures/snapshot/typescript.js:73896–73915  ·  view source on GitHub ↗
(node, checkMode)

Source from the content-addressed store, hash-verified

73894 }
73895 }
73896 function checkJsxChildren(node, checkMode) {
73897 var childrenTypes = [];
73898 for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
73899 var child = _a[_i];
73900 // In React, JSX text that contains only whitespaces will be ignored so we don't want to type-check that
73901 // because then type of children property will have constituent of string type.
73902 if (child.kind === 11 /* SyntaxKind.JsxText */) {
73903 if (!child.containsOnlyTriviaWhiteSpaces) {
73904 childrenTypes.push(stringType);
73905 }
73906 }
73907 else if (child.kind === 288 /* SyntaxKind.JsxExpression */ && !child.expression) {
73908 continue; // empty jsx expressions don't *really* count as present children
73909 }
73910 else {
73911 childrenTypes.push(checkExpressionForMutableLocation(child, checkMode));
73912 }
73913 }
73914 return childrenTypes;
73915 }
73916 function checkSpreadPropOverrides(type, props, spread) {
73917 for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
73918 var right = _a[_i];

Callers 4

elaborateJsxComponentsFunction · 0.85
checkJsxElementDeferredFunction · 0.85
checkJsxFragmentFunction · 0.85

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…