fix linter issues
This commit is contained in:
12
.cspell.json
12
.cspell.json
@@ -47,6 +47,16 @@
|
|||||||
"mixins",
|
"mixins",
|
||||||
"Explorerdmg",
|
"Explorerdmg",
|
||||||
"heapsnapshot",
|
"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 = {}
|
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)
|
||||||
|
|
||||||
|
|||||||
@@ -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
Reference in New Issue
Block a user