code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function typeRelatedToSomeType(source, target, reportErrors) {
var targetTypes = target.types;
for (var i = 0, len = targetTypes.length; i < len; i++) {
var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1);
if (related) ... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | typeRelatedToSomeType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function typeRelatedToEachType(source, target, reportErrors) {
var result = -1 /* True */;
var targetTypes = target.types;
for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
var targetType = targetTypes_1[_i];
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | typeRelatedToEachType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function someTypeRelatedToType(source, target, reportErrors) {
var sourceTypes = source.types;
for (var i = 0, len = sourceTypes.length; i < len; i++) {
var related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1);
if (related) ... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | someTypeRelatedToType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function eachTypeRelatedToType(source, target, reportErrors) {
var result = -1 /* True */;
var sourceTypes = source.types;
for (var _i = 0, sourceTypes_2 = sourceTypes; _i < sourceTypes_2.length; _i++) {
var sourceType = sourceTypes_2[_i];
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | eachTypeRelatedToType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function typeArgumentsRelatedTo(source, target, reportErrors) {
var sources = source.typeArguments || emptyArray;
var targets = target.typeArguments || emptyArray;
if (sources.length !== targets.length && relation === identityRelation) {
return 0 /* Fa... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | typeArgumentsRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function typeParameterIdenticalTo(source, target) {
// covers case when both type parameters does not have constraint (both equal to noConstraintType)
if (source.constraint === target.constraint) {
return -1 /* True */;
}
if (source.con... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | typeParameterIdenticalTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function objectTypeRelatedTo(apparentSource, originalSource, target, reportErrors) {
if (overflow) {
return 0 /* False */;
}
var id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + ","... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | objectTypeRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function propertiesRelatedTo(source, target, reportErrors) {
if (relation === identityRelation) {
return propertiesIdenticalTo(source, target);
}
var result = -1 /* True */;
var properties = getPropertiesOfObjectType(target);
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | propertiesRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function propertiesIdenticalTo(source, target) {
if (!(source.flags & 80896 /* ObjectType */ && target.flags & 80896 /* ObjectType */)) {
return 0 /* False */;
}
var sourceProperties = getPropertiesOfObjectType(source);
var targetProper... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | propertiesIdenticalTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function signaturesRelatedTo(source, target, kind, reportErrors) {
if (relation === identityRelation) {
return signaturesIdenticalTo(source, target, kind);
}
if (target === anyFunctionType || source === anyFunctionType) {
return -1 ... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | signaturesRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function abstractSignatureRelatedTo(source, sourceSig, target, targetSig) {
if (sourceSig && targetSig) {
var sourceDecl = source.symbol && getClassLikeDeclarationOfSymbol(source.symbol);
var targetDecl = target.symbol && getClassLikeDeclarationOfSymbo... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | abstractSignatureRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function signatureRelatedTo(source, target, reportErrors) {
if (source === target) {
return -1 /* True */;
}
if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) {
return 0 /* False */;
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | signatureRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function signaturesIdenticalTo(source, target, kind) {
var sourceSignatures = getSignaturesOfType(source, kind);
var targetSignatures = getSignaturesOfType(target, kind);
if (sourceSignatures.length !== targetSignatures.length) {
return 0 /* False */;
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | signaturesIdenticalTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function stringIndexTypesRelatedTo(source, originalSource, target, reportErrors) {
if (relation === identityRelation) {
return indexTypesIdenticalTo(0 /* String */, source, target);
}
var targetType = getIndexTypeOfType(target, 0 /* String */);
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | stringIndexTypesRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function numberIndexTypesRelatedTo(source, originalSource, target, reportErrors) {
if (relation === identityRelation) {
return indexTypesIdenticalTo(1 /* Number */, source, target);
}
var targetType = getIndexTypeOfType(target, 1 /* Number */);
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | numberIndexTypesRelatedTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function indexTypesIdenticalTo(indexKind, source, target) {
var targetType = getIndexTypeOfType(target, indexKind);
var sourceType = getIndexTypeOfType(source, indexKind);
if (!sourceType && !targetType) {
return -1 /* True */;
}
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | indexTypesIdenticalTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isPropertyIdenticalTo(sourceProp, targetProp) {
return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */;
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isPropertyIdenticalTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function compareProperties(sourceProp, targetProp, compareTypes) {
// Two members are considered identical when
// - they are public properties with identical names, optionality, and types,
// - they are private or protected properties originating in the same declaration and having i... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | compareProperties | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isMatchingSignature(source, target, partialMatch) {
// A source signature matches a target signature if the two signatures have the same number of required,
// optional, and rest parameters.
if (source.parameters.length === target.parameters.length &&
source.... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isMatchingSignature | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) {
if (source === target) {
return -1 /* True */;
}
if (!(isMatchingSignature(source, target, partialMatch))) {
return 0 /* False */;
}
var... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | compareSignatures | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isRestParameterIndex(signature, parameterIndex) {
return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1;
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isRestParameterIndex | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isSupertypeOfEach(candidate, types) {
for (var _i = 0, types_6 = types; _i < types_6.length; _i++) {
var type = types_6[_i];
if (candidate !== type && !isTypeSubtypeOf(type, candidate))
return false;
}
return true;
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isSupertypeOfEach | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getCommonSupertype(types) {
return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; });
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | getCommonSupertype | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) {
// The downfallType/bestSupertypeDownfallType is the first type that caused a particular candidate
// to not be the common supertype. So if it weren't for this one downfallType (and possibly others),
... | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | reportNoCommonSupertypeError | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isArrayType(type) {
return type.flags & 4096 /* Reference */ && type.target === globalArrayType;
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isArrayType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isArrayLikeType(type) {
// A type is array-like if it is not the undefined or null type and if it is assignable to any[]
return !(type.flags & (32 /* Undefined */ | 64 /* Null */)) && isTypeAssignableTo(type, anyArrayType);
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isArrayLikeType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTupleLikeType(type) {
return !!getPropertyOfType(type, "0");
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isTupleLikeType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isStringLiteralType(type) {
return type.flags & 256 /* StringLiteral */;
} | Checks if 'source' is related to 'target' (e.g.: is a assignable to).
@param source The left-hand-side of the relation.
@param target The right-hand-side of the relation.
@param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
Used as both to determine which check... | isStringLiteralType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTupleType(type) {
return !!(type.flags & 8192 /* Tuple */);
} | Check if a Type was written as a tuple type literal.
Prefer using isTupleLikeType() unless the use of `elementTypes` is required. | isTupleType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getRegularTypeOfObjectLiteral(type) {
if (type.flags & 1048576 /* FreshObjectLiteral */) {
var regularType = type.regularType;
if (!regularType) {
regularType = createType(type.flags & ~1048576 /* FreshObjectLiteral */);
regula... | Check if a Type was written as a tuple type literal.
Prefer using isTupleLikeType() unless the use of `elementTypes` is required. | getRegularTypeOfObjectLiteral | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getWidenedTypeOfObjectLiteral(type) {
var properties = getPropertiesOfObjectType(type);
var members = {};
ts.forEach(properties, function (p) {
var propType = getTypeOfSymbol(p);
var widenedType = getWidenedType(propType);
if (... | Check if a Type was written as a tuple type literal.
Prefer using isTupleLikeType() unless the use of `elementTypes` is required. | getWidenedTypeOfObjectLiteral | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getWidenedType(type) {
if (type.flags & 6291456 /* RequiresWidening */) {
if (type.flags & (32 /* Undefined */ | 64 /* Null */)) {
return anyType;
}
if (type.flags & 524288 /* ObjectLiteral */) {
return getWiden... | Check if a Type was written as a tuple type literal.
Prefer using isTupleLikeType() unless the use of `elementTypes` is required. | getWidenedType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reportWideningErrorsInType(type) {
var errorReported = false;
if (type.flags & 16384 /* Union */) {
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
if (reportWideningErrorsInType(t)) {
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | reportWideningErrorsInType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reportImplicitAnyError(declaration, type) {
var typeAsString = typeToString(getWidenedType(type));
var diagnostic;
switch (declaration.kind) {
case 141 /* PropertyDeclaration */:
case 140 /* PropertySignature */:
diagnostic... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | reportImplicitAnyError | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reportErrorsFromWidening(declaration, type) {
if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 2097152 /* ContainsUndefinedOrNull */) {
// Report implicit any error within type if possible, otherwise report error on declaration
if (!reportWiden... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | reportErrorsFromWidening | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function forEachMatchingParameterType(source, target, callback) {
var sourceMax = source.parameters.length;
var targetMax = target.parameters.length;
var count;
if (source.hasRestParameter && target.hasRestParameter) {
count = sourceMax > targetMax ? sourc... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | forEachMatchingParameterType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function createInferenceContext(typeParameters, inferUnionTypes) {
var inferences = [];
for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
var unused = typeParameters_1[_i];
inferences.push({
primary: unde... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | createInferenceContext | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inferTypes(context, source, target) {
var sourceStack;
var targetStack;
var depth = 0;
var inferiority = 0;
inferFromTypes(source, target);
function isInProcess(source, target) {
for (var i = 0; i < depth; i++) {
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | inferTypes | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInProcess(source, target) {
for (var i = 0; i < depth; i++) {
if (source === sourceStack[i] && target === targetStack[i]) {
return true;
}
}
return false;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isInProcess | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inferFromTypes(source, target) {
if (target.flags & 512 /* TypeParameter */) {
// If target is a type parameter, make an inference, unless the source type contains
// the anyFunctionType (the wildcard type that's used to avoid contextually typing function... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | inferFromTypes | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inferFromProperties(source, target) {
var properties = getPropertiesOfObjectType(target);
for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) {
var targetProp = properties_2[_i];
var sourceProp = getPropertyOfObject... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | inferFromProperties | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inferFromSignatures(source, target, kind) {
var sourceSignatures = getSignaturesOfType(source, kind);
var targetSignatures = getSignaturesOfType(target, kind);
var sourceLen = sourceSignatures.length;
var targetLen = targetSignatures.length;
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | inferFromSignatures | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inferFromSignature(source, target) {
forEachMatchingParameterType(source, target, inferFromTypes);
if (source.typePredicate && target.typePredicate) {
if (target.typePredicate.parameterIndex === source.typePredicate.parameterIndex) {
/... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | inferFromSignature | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inferFromIndexTypes(source, target, sourceKind, targetKind) {
var targetIndexType = getIndexTypeOfType(target, targetKind);
if (targetIndexType) {
var sourceIndexType = getIndexTypeOfType(source, sourceKind);
if (sourceIndexType) {
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | inferFromIndexTypes | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getInferenceCandidates(context, index) {
var inferences = context.inferences[index];
return inferences.primary || inferences.secondary || emptyArray;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getInferenceCandidates | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getInferredType(context, index) {
var inferredType = context.inferredTypes[index];
var inferenceSucceeded;
if (!inferredType) {
var inferences = getInferenceCandidates(context, index);
if (inferences.length) {
// Infer wide... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getInferredType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getInferredTypes(context) {
for (var i = 0; i < context.inferredTypes.length; i++) {
getInferredType(context, i);
}
return context.inferredTypes;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getInferredTypes | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function hasAncestor(node, kind) {
return ts.getAncestor(node, kind) !== undefined;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | hasAncestor | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getResolvedSymbol(node) {
var links = getNodeLinks(node);
if (!links.resolvedSymbol) {
links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymb... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getResolvedSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInTypeQuery(node) {
// TypeScript 1.0 spec (April 2014): 3.6.3
// A type query consists of the keyword typeof followed by an expression.
// The expression is restricted to a single identifier or a sequence of identifiers separated by periods
while (node) {
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isInTypeQuery | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function hasInitializer(node) {
return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent));
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | hasInitializer | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isAssignedInBinaryExpression(node) {
if (node.operatorToken.kind >= 56 /* FirstAssignment */ && node.operatorToken.kind <= 68 /* LastAssignment */) {
var n = node.left;
while (n.kind === 172 /* ParenthesizedExpression */) {
n = n.e... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isAssignedInBinaryExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isAssignedInVariableDeclaration(node) {
if (!ts.isBindingPattern(node.name) && getSymbolOfNode(node) === symbol && hasInitializer(node)) {
return true;
}
return ts.forEachChild(node, isAssignedIn);
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isAssignedInVariableDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isAssignedIn(node) {
switch (node.kind) {
case 181 /* BinaryExpression */:
return isAssignedInBinaryExpression(node);
case 211 /* VariableDeclaration */:
case 163 /* BindingElement */:
re... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isAssignedIn | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getNarrowedTypeOfSymbol(symbol, node) {
var type = getTypeOfSymbol(symbol);
// Only narrow when symbol is variable of type any or an object, union, or type parameter type
if (node && symbol.flags & 3 /* Variable */) {
if (isTypeAny(type) || type.flags & (8089... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getNarrowedTypeOfSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function narrowTypeByEquality(type, expr, assumeTrue) {
// Check that we have 'typeof <symbol>' on the left and string literal on the right
if (expr.left.kind !== 176 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) {
return type;
}... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | narrowTypeByEquality | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function narrowTypeByAnd(type, expr, assumeTrue) {
if (assumeTrue) {
// The assumed result is true, therefore we narrow assuming each operand to be true.
return narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ true);
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | narrowTypeByAnd | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function narrowTypeByOr(type, expr, assumeTrue) {
if (assumeTrue) {
// The assumed result is true. This means either the first operand was true, or the first operand was false
// and the second operand was true. We narrow with those assumptions and union the two r... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | narrowTypeByOr | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function narrowTypeByInstanceof(type, expr, assumeTrue) {
// Check that type is not any, assumed result is true, and we have variable symbol on the left
if (isTypeAny(type) || expr.left.kind !== 69 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) {
return ... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | narrowTypeByInstanceof | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getNarrowedType(originalType, narrowedTypeCandidate) {
// If the current type is a union type, remove all constituents that aren't assignable to target. If that produces
// 0 candidates, fall back to the assignability check
if (originalType.flags & 16384 /* Union... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getNarrowedType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function narrowTypeByTypePredicate(type, expr, assumeTrue) {
if (type.flags & 1 /* Any */) {
return type;
}
var signature = getResolvedSignature(expr);
if (signature.typePredicate &&
expr.arguments[signature.typePred... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | narrowTypeByTypePredicate | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkIdentifier(node) {
var symbol = getResolvedSymbol(node);
// As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects.
// Although in down-level emit of arrow function, we emit it using function expression which means that
// ar... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | checkIdentifier | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInsideFunction(node, threshold) {
var current = node;
while (current && current !== threshold) {
if (ts.isFunctionLike(current)) {
return true;
}
current = current.parent;
}
return false;
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isInsideFunction | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkBlockScopedBindingCapturedInLoop(node, symbol) {
if (languageVersion >= 2 /* ES6 */ ||
(symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 ||
symbol.valueDeclaration.parent.kind === 244 /* CatchClause */) {
return;
}... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | checkBlockScopedBindingCapturedInLoop | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2 /* LexicalThis */;
if (container.kind === 141 /* PropertyDeclaration */ || container.kind === 144 /* Constructor */) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | captureLexicalThis | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkThisExpression(node) {
// Stop at the first arrow function so that we can
// tell whether 'this' needs to be captured.
var container = ts.getThisContainer(node, /* includeArrowFunctions */ true);
var needToCaptureLexicalThis = false;
// Now skip ... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | checkThisExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInConstructorArgumentInitializer(node, constructorDecl) {
for (var n = node; n && n !== constructorDecl; n = n.parent) {
if (n.kind === 138 /* Parameter */) {
return true;
}
}
return false;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isInConstructorArgumentInitializer | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkSuperExpression(node) {
var isCallExpression = node.parent.kind === 168 /* CallExpression */ && node.parent.expression === node;
var classDeclaration = ts.getContainingClass(node);
var classType = classDeclaration && getDeclaredTypeOfSymbol(getSymbolOfNode(classDeclarat... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | checkSuperExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isLegalUsageOfSuperExpression(container) {
if (!container) {
return false;
}
if (isCallExpression) {
// TS 1.0 SPEC (April 2014): 4.8.1
// Super calls are only permitted in constructors of derived classe... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isLegalUsageOfSuperExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForReturnExpression(node) {
var func = ts.getContainingFunction(node);
if (func && !func.asteriskToken) {
return getContextualReturnType(func);
}
return undefined;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForReturnExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForYieldOperand(node) {
var func = ts.getContainingFunction(node);
if (func) {
var contextualReturnType = getContextualReturnType(func);
if (contextualReturnType) {
return node.asteriskToken
? c... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForYieldOperand | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInParameterInitializerBeforeContainingFunction(node) {
while (node.parent && !ts.isFunctionLike(node.parent)) {
if (node.parent.kind === 138 /* Parameter */ && node.parent.initializer === node) {
return true;
}
node = node.parent... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | isInParameterInitializerBeforeContainingFunction | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualReturnType(functionDecl) {
// If the containing function has a return type annotation, is a constructor, or is a get accessor whose
// corresponding set accessor has a type annotation, return statements in the function are contextually typed
if (functionDecl.typ... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualReturnType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForArgument(callTarget, arg) {
var args = getEffectiveCallArguments(callTarget);
var argIndex = ts.indexOf(args, arg);
if (argIndex >= 0) {
var signature = getResolvedSignature(callTarget);
return getTypeAtPosition(signature, ... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForArgument | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
if (template.parent.kind === 170 /* TaggedTemplateExpression */) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForSubstitutionExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForBinaryOperand(node) {
var binaryExpression = node.parent;
var operator = binaryExpression.operatorToken.kind;
if (operator >= 56 /* FirstAssignment */ && operator <= 68 /* LastAssignment */) {
// In an assignment expression, the right oper... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForBinaryOperand | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function applyToContextualType(type, mapper) {
if (!(type.flags & 16384 /* Union */)) {
return mapper(type);
}
var types = type.types;
var mappedType;
var mappedTypes;
for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | applyToContextualType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTypeOfPropertyOfContextualType(type, name) {
return applyToContextualType(type, function (t) {
var prop = t.flags & 130048 /* StructuredType */ ? getPropertyOfType(t, name) : undefined;
return prop ? getTypeOfSymbol(prop) : undefined;
});
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getTypeOfPropertyOfContextualType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getIndexTypeOfContextualType(type, kind) {
return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); });
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getIndexTypeOfContextualType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function contextualTypeIsStringLiteralType(type) {
return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isStringLiteralType) : isStringLiteralType(type));
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | contextualTypeIsStringLiteralType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function contextualTypeIsTupleLikeType(type) {
return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type));
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | contextualTypeIsTupleLikeType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForObjectLiteralElement(element) {
var objectLiteral = element.parent;
var type = getApparentTypeOfContextualType(objectLiteral);
if (type) {
if (!ts.hasDynamicName(element)) {
// For a (non-symbol) computed property, ther... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForObjectLiteralElement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForElementExpression(node) {
var arrayLiteral = node.parent;
var type = getApparentTypeOfContextualType(arrayLiteral);
if (type) {
var index = ts.indexOf(arrayLiteral.elements, node);
return getTypeOfPropertyOfContextualType(t... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForElementExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualTypeForJsxExpression(expr) {
// Contextual type only applies to JSX expressions that are in attribute assignments (not in 'Children' positions)
if (expr.parent.kind === 238 /* JsxAttribute */) {
var attrib = expr.parent;
var attrsType = getJs... | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getContextualTypeForJsxExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getApparentTypeOfContextualType(node) {
var type = getContextualType(node);
return type && getApparentType(type);
} | Reports implicit any errors that occur as a result of widening 'null' and 'undefined'
to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to
getWidenedType. But in some cases getWidenedType is called without reporting errors
(type argument inference is an example).
The return value indicat... | getApparentTypeOfContextualType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualType(node) {
if (isInsideWithStatementBody(node)) {
// We cannot answer semantic questions within a with block, do not proceed any further
return undefined;
}
if (node.contextualType) {
return node.contextualType;
... | Woah! Do you really want to use this function?
Unless you're trying to get the *non-apparent* type for a
value-literal type or you're authoring relevant portions of this algorithm,
you probably meant to use 'getApparentTypeOfContextualType'.
Otherwise this may not be very useful.
In cases where you *are* working on t... | getContextualType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isFunctionExpressionOrArrowFunction(node) {
return node.kind === 173 /* FunctionExpression */ || node.kind === 174 /* ArrowFunction */;
} | Woah! Do you really want to use this function?
Unless you're trying to get the *non-apparent* type for a
value-literal type or you're authoring relevant portions of this algorithm,
you probably meant to use 'getApparentTypeOfContextualType'.
Otherwise this may not be very useful.
In cases where you *are* working on t... | isFunctionExpressionOrArrowFunction | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualSignatureForFunctionLikeDeclaration(node) {
// Only function expressions, arrow functions, and object literal methods are contextually typed.
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
? getContextualSignature(node)
... | Woah! Do you really want to use this function?
Unless you're trying to get the *non-apparent* type for a
value-literal type or you're authoring relevant portions of this algorithm,
you probably meant to use 'getApparentTypeOfContextualType'.
Otherwise this may not be very useful.
In cases where you *are* working on t... | getContextualSignatureForFunctionLikeDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getContextualSignature(node) {
ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
var type = ts.isObjectLiteralMethod(node)
? getContextualTypeForObjectLiteralMethod(node)
: getApparentTypeOfContextualType(node);... | Woah! Do you really want to use this function?
Unless you're trying to get the *non-apparent* type for a
value-literal type or you're authoring relevant portions of this algorithm,
you probably meant to use 'getApparentTypeOfContextualType'.
Otherwise this may not be very useful.
In cases where you *are* working on t... | getContextualSignature | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInferentialContext(mapper) {
return mapper && mapper.context;
} | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | isInferentialContext | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkSpreadElementExpression(node, contextualMapper) {
// It is usually not safe to call checkExpressionCached if we can be contextually typing.
// You can tell that we are contextually typing because of the contextualMapper parameter.
// While it is true that a spread eleme... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | checkSpreadElementExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function hasDefaultValue(node) {
return (node.kind === 163 /* BindingElement */ && !!node.initializer) ||
(node.kind === 181 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */);
} | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | hasDefaultValue | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkArrayLiteral(node, contextualMapper) {
var elements = node.elements;
var hasSpreadElement = false;
var elementTypes = [];
var inDestructuringPattern = isAssignmentTarget(node);
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++)... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | checkArrayLiteral | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNumericName(name) {
return name.kind === 136 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text);
} | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | isNumericName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNumericComputedName(name) {
// It seems odd to consider an expression of type Any to result in a numeric name,
// but this behavior is consistent with checkIndexedAccess
return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 132 /* NumberLike */);
... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | isNumericComputedName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) {
return isTypeAny(type) || allConstituentTypesHaveKind(type, kind);
} | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | isTypeAnyOrAllConstituentTypesHaveKind | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNumericLiteralName(name) {
// The intent of numeric names is that
// - they are names with text in a numeric form, and that
// - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit',
// acquire... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | isNumericLiteralName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkComputedPropertyName(node) {
var links = getNodeLinks(node.expression);
if (!links.resolvedType) {
links.resolvedType = checkExpression(node.expression);
// This will allow types number, string, symbol or any. It will also allow enums, the unknown
... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | checkComputedPropertyName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkObjectLiteral(node, contextualMapper) {
var inDestructuringPattern = isAssignmentTarget(node);
// Grammar checking
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
var propertiesTable = {};
var propertiesArray = [];
... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | checkObjectLiteral | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getIndexType(kind) {
if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) {
var propTypes = [];
for (var i = 0; i < propertiesArray.length; i++) {
var propertyDecl = node.properties[i];
... | Detect if the mapper implies an inference context. Specifically, there are 4 possible values
for a mapper. Let's go through each one of them:
1. undefined - this means we are not doing inferential typing, but we may do contextual typing,
which could cause us to assign a parameter a type
2. identityMapper -... | getIndexType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.