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

Function maybeTypeOfKind

test/fixtures/snapshot/typescript.js:78548–78562  ·  view source on GitHub ↗
(type, kind)

Source from the content-addressed store, hash-verified

78546 // Return true if type might be of the given kind. A union or intersection type might be of a given
78547 // kind if at least one constituent type is of the given kind.
78548 function maybeTypeOfKind(type, kind) {
78549 if (type.flags & kind) {
78550 return true;
78551 }
78552 if (type.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
78553 var types = type.types;
78554 for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
78555 var t = types_21[_i];
78556 if (maybeTypeOfKind(t, kind)) {
78557 return true;
78558 }
78559 }
78560 }
78561 return false;
78562 }
78563 function isTypeAssignableToKind(source, kind, strict) {
78564 if (source.flags & kind) {
78565 return true;

Calls

no outgoing calls

Tested by

no test coverage detected