mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user