Fix "noStringLiteral" lint errors (#19310)

This commit is contained in:
Andy
2017-10-19 08:15:48 -07:00
committed by GitHub
parent a53d3bb5aa
commit 1f282f19e0
15 changed files with 64 additions and 63 deletions

View File

@@ -84,9 +84,9 @@ function main(): void {
function xmlObjectToString(o: any) {
const out: any = {};
for (const item of o["LCX"]["Item"][0]["Item"][0]["Item"]) {
let ItemId = item["$"]["ItemId"];
let Val = item["Str"][0]["Tgt"] ? item["Str"][0]["Tgt"][0]["Val"][0] : item["Str"][0]["Val"][0];
for (const item of o.LCX.Item[0].Item[0].Item) {
let ItemId = item.$.ItemId;
let Val = item.Str[0].Tgt ? item.Str[0].Tgt[0].Val[0] : item.Str[0].Val[0];
if (typeof ItemId !== "string" || typeof Val !== "string") {
console.error("Unexpected XML file structure");