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 committed 2017-06-30 09:23:00 -07:00
1 parent f172f72e76
commit 2eec7f3565
3 files changed
+4 -16

No files matched your search

+1 -1
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;
}
}