fix linter issues
This commit is contained in:
12
.cspell.json
12
.cspell.json
@@ -47,6 +47,16 @@
|
||||
"mixins",
|
||||
"Explorerdmg",
|
||||
"heapsnapshot",
|
||||
"noconflict"
|
||||
"noconflict",
|
||||
"sparkplugb",
|
||||
"protojson",
|
||||
"protobuf",
|
||||
"tahu",
|
||||
"Protobufs",
|
||||
"propertyset",
|
||||
"datatypes",
|
||||
"ldelim",
|
||||
"propertysets",
|
||||
"protoc"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ function nodeDotPathToHistory(startTime: number | undefined, history: q.MessageH
|
||||
let json: any = {}
|
||||
try {
|
||||
json = message.payload ? JSON.parse(Base64Message.toUnicodeString(message.payload)) : {}
|
||||
} catch (ignore) {
|
||||
} catch (ignore) {}
|
||||
|
||||
// sparkplugb
|
||||
try {
|
||||
json = message.payload ? Payload.toJSON(Payload.decode(Base64Message.toUint8Array(message.payload))) : {}
|
||||
} catch (ignore) {}
|
||||
}
|
||||
|
||||
const value = dotProp.get(json, dotPath)
|
||||
|
||||
|
||||
@@ -29,12 +29,13 @@ export class Base64Message {
|
||||
}
|
||||
|
||||
public static toUint8Array(message: Base64Message) {
|
||||
var binary_string = window.atob(message.base64Message);
|
||||
var len = binary_string.length;
|
||||
var bytes = new Uint8Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
bytes[i] = binary_string.charCodeAt(i);
|
||||
const binaryString = window.atob(message.base64Message)
|
||||
const len = binaryString.length
|
||||
const bytes = new Uint8Array(len)
|
||||
for (const i of Array.from(Array(len).keys())) {
|
||||
bytes[i] = binaryString.charCodeAt(i)
|
||||
}
|
||||
|
||||
return bytes
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user