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

Function isPartiallyInferableType

test/fixtures/snapshot/typescript.js:68212–68216  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

68210 // literal { a: 123, b: x => true } is marked non-inferable because it contains a context sensitive
68211 // arrow function, but is considered partially inferable because property 'a' has an inferable type.
68212 function isPartiallyInferableType(type) {
68213 return !(ts.getObjectFlags(type) & 262144 /* ObjectFlags.NonInferrableType */) ||
68214 isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) ||
68215 isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType);
68216 }
68217 function createReverseMappedType(source, target, constraint) {
68218 // We consider a source type reverse mappable if it has a string index signature or if
68219 // it has one or more properties and is of a partially inferable type.

Callers 1

createReverseMappedTypeFunction · 0.85

Calls 6

isObjectLiteralTypeFunction · 0.85
getPropertiesOfTypeFunction · 0.85
getTypeOfSymbolFunction · 0.85
isTupleTypeFunction · 0.85
getTypeArgumentsFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected