mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
Even more succinct
This commit is contained in:
@@ -14960,9 +14960,8 @@ namespace ts {
|
||||
}
|
||||
// If no inferences can be made to K's constraint, infer from a union of the property types
|
||||
// in the source to the template type X.
|
||||
const indexInfo = getIndexInfoOfType(source, IndexKind.String) || getIndexInfoOfType(source, IndexKind.Number);
|
||||
const indexType = indexInfo && indexInfo !== enumNumberIndexInfo ? indexInfo.type : undefined;
|
||||
const sourcePropsType = indexType || getUnionType(map(getPropertiesOfType(source), getTypeOfSymbol));
|
||||
const indexInfo = getIndexInfoOfType(source, IndexKind.String) || getNonEnumNumberIndexInfo(source);
|
||||
const sourcePropsType = indexInfo && indexInfo.type || getUnionType(map(getPropertiesOfType(source), getTypeOfSymbol));
|
||||
inferFromTypes(sourcePropsType, getTemplateTypeFromMappedType(target));
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user