fix linter issues

This commit is contained in:
Sinuhe Tellez
2021-08-10 22:59:59 -04:00
parent f60449c253
commit 86f5b94852
4 changed files with 1115 additions and 1339 deletions

View File

@@ -47,6 +47,16 @@
"mixins", "mixins",
"Explorerdmg", "Explorerdmg",
"heapsnapshot", "heapsnapshot",
"noconflict" "noconflict",
"sparkplugb",
"protojson",
"protobuf",
"tahu",
"Protobufs",
"propertyset",
"datatypes",
"ldelim",
"propertysets",
"protoc"
] ]
} }

View File

@@ -41,12 +41,12 @@ function nodeDotPathToHistory(startTime: number | undefined, history: q.MessageH
let json: any = {} let json: any = {}
try { try {
json = message.payload ? JSON.parse(Base64Message.toUnicodeString(message.payload)) : {} json = message.payload ? JSON.parse(Base64Message.toUnicodeString(message.payload)) : {}
} catch (ignore) { } catch (ignore) {}
// sparkplugb // sparkplugb
try { try {
json = message.payload ? Payload.toJSON(Payload.decode(Base64Message.toUint8Array(message.payload))) : {} json = message.payload ? Payload.toJSON(Payload.decode(Base64Message.toUint8Array(message.payload))) : {}
} catch (ignore) {} } catch (ignore) {}
}
const value = dotProp.get(json, dotPath) const value = dotProp.get(json, dotPath)

View File

@@ -29,12 +29,13 @@ export class Base64Message {
} }
public static toUint8Array(message: Base64Message) { public static toUint8Array(message: Base64Message) {
var binary_string = window.atob(message.base64Message); const binaryString = window.atob(message.base64Message)
var len = binary_string.length; const len = binaryString.length
var bytes = new Uint8Array(len); const bytes = new Uint8Array(len)
for (var i = 0; i < len; i++) { for (const i of Array.from(Array(len).keys())) {
bytes[i] = binary_string.charCodeAt(i); bytes[i] = binaryString.charCodeAt(i)
} }
return bytes return bytes
} }
} }

File diff suppressed because it is too large Load Diff