Skip to content

Commit af64ef8

Browse files
author
Andy
authored
Merge pull request #15141 from Microsoft/getOwnKeys
Remove unnecessary use of getOwnKeys
2 parents dbb1252 + 4ae8df6 commit af64ef8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/commandLineParser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ namespace ts {
10071007
let seenKnownKeys = 0;
10081008
const nameColumn: string[] = [];
10091009
const descriptionColumn: string[] = [];
1010-
const knownKesyCount = getOwnKeys(configurations.compilerOptions).length;
1010+
const knownKeysCount = getOwnKeys(configurations.compilerOptions).length;
10111011
for (const category in categorizedOptions) {
10121012
if (nameColumn.length !== 0) {
10131013
nameColumn.push("");
@@ -1018,7 +1018,7 @@ namespace ts {
10181018
for (const option of categorizedOptions[category]) {
10191019
let optionName;
10201020
if (hasProperty(configurations.compilerOptions, option.name)) {
1021-
optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}`;
1021+
optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKeysCount ? "" : ","}`;
10221022
}
10231023
else {
10241024
optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`;

src/compiler/core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ namespace ts {
945945
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]): any;
946946
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]) {
947947
for (const arg of args) {
948-
for (const p of getOwnKeys(arg)) {
948+
for (const p in arg) if (hasProperty(arg, p)) {
949949
t[p] = arg[p];
950950
}
951951
}

0 commit comments

Comments
 (0)