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",
"Explorerdmg",
"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 = {}
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)

View File

@@ -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