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

Function isWeakType

test/fixtures/snapshot/typescript.js:66948–66958  ·  view source on GitHub ↗

* A type is 'weak' if it is an object type with at least one optional property * and no required properties, call/construct signatures or index signatures

(type)

Source from the content-addressed store, hash-verified

66946 * and no required properties, call/construct signatures or index signatures
66947 */
66948 function isWeakType(type) {
66949 if (type.flags & 524288 /* TypeFlags.Object */) {
66950 var resolved = resolveStructuredTypeMembers(type);
66951 return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 && resolved.indexInfos.length === 0 &&
66952 resolved.properties.length > 0 && ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216 /* SymbolFlags.Optional */); });
66953 }
66954 if (type.flags & 2097152 /* TypeFlags.Intersection */) {
66955 return ts.every(type.types, isWeakType);
66956 }
66957 return false;
66958 }
66959 function hasCommonProperties(source, target, isComparingJsxAttributes) {
66960 for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
66961 var prop = _a[_i];

Callers 1

isRelatedToFunction · 0.85

Calls 2

everyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…