Dedupe some utility code

1. convertToArray is a duplicate of arrayFrom
2. inferFromParameterTypes delegates immediately to inferFromTypes
3. One usage of arrayFrom instantiated a whole iterator only to take the
first element, which is the same as calling `next`.
This commit is contained in:
Nathan Shively-Sanders
2017-06-30 09:23:00 -07:00
parent f172f72e76
commit 2eec7f3565
3 changed files with 4 additions and 16 deletions

View File

@@ -1290,7 +1290,7 @@ namespace ts {
case "object":
return {};
default:
return arrayFrom((<CommandLineOptionOfCustomType>option).type.keys())[0];
return (option as CommandLineOptionOfCustomType).type.keys().next().value;
}
}