mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixing few code review comments
This commit is contained in:
1 parent
0fe282e719
commit
ce652dc7fb
4 files changed
+11
-7
No files matched your search
@@ -375,9 +375,14 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses non quoted strings separated by comma e.g. "a,b" would result in string array ["a", "b"]
|
||||
* @param s
|
||||
* @param existingValue
|
||||
*/
|
||||
function parseMultiValueStringArray(s: string, existingValue: string[]) {
|
||||
let value: string[] = existingValue || [];
|
||||
let hasError: boolean;
|
||||
let hasError = false;
|
||||
let currentString = "";
|
||||
if (s) {
|
||||
for (let i = 0; i < s.length; i++) {
|
||||
@@ -480,8 +485,7 @@ namespace ts {
|
||||
}
|
||||
// Check if the value asked was string[] and value provided was not string[]
|
||||
else if (expectedType !== "string[]" ||
|
||||
typeof jsonValue !== "object" ||
|
||||
typeof jsonValue.length !== "number" ||
|
||||
!(jsonValue instanceof Array) ||
|
||||
forEach(<string[]>jsonValue, individualValue => typeof individualValue !== "string")) {
|
||||
// Not expectedType
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType));
|
||||
|
||||
Reference in new issue
Block a user