use length helper

This commit is contained in:
Arthur Ozga 2017-06-01 11:09:08 -07:00
parent f9123aa5cc
commit f2163fecbd

View File

@ -147,7 +147,7 @@ namespace ts.codefix {
let typeParameters: TypeParameterDeclaration[];
if (includeTypeScriptSyntax) {
const typeArgCount = callExpression.typeArguments ? callExpression.typeArguments.length : 0;
const typeArgCount = length(callExpression.typeArguments);
for (let i = 0; i < typeArgCount; i++) {
const name = typeArgCount < 8 ? String.fromCharCode(CharacterCodes.T + i) : `T${i}`;
const typeParameter = createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined);