chore: upgrade prettier and fix linting errors
This commit is contained in:
@@ -3,11 +3,7 @@ import * as fs from 'fs-extra'
|
||||
import * as lowdb from 'lowdb'
|
||||
import * as path from 'path'
|
||||
import { backendRpc } from '../../events'
|
||||
import {
|
||||
storageClearEvent,
|
||||
storageLoadEvent,
|
||||
storageStoreEvent,
|
||||
} from '../../events/StorageEvents'
|
||||
import { storageClearEvent, storageLoadEvent, storageStoreEvent } from '../../events/StorageEvents'
|
||||
|
||||
export default class ConfigStorage {
|
||||
private file: string
|
||||
|
||||
@@ -47,7 +47,6 @@ export class MqttSource implements DataSource<MqttOptions> {
|
||||
throw error
|
||||
}
|
||||
|
||||
|
||||
const client = mqttConnect(url.toString(), {
|
||||
resubscribe: false,
|
||||
rejectUnauthorized: options.certValidation,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export enum Decoder {
|
||||
NONE,
|
||||
SPARKPLUG
|
||||
NONE,
|
||||
SPARKPLUG,
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export class Tree<ViewModel extends Destroyable> extends TreeNode<ViewModel> {
|
||||
if (!this.paused && this.applyChangesHasCompleted) {
|
||||
this.applyChangesHasCompleted = false
|
||||
if ((window as any).requestIdleCallback) {
|
||||
; (window as any).requestIdleCallback(() => this.applyUnmergedChanges(), { timeout: 500 })
|
||||
;(window as any).requestIdleCallback(() => this.applyUnmergedChanges(), { timeout: 500 })
|
||||
} else {
|
||||
this.applyUnmergedChanges()
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { readFileSync } from 'fs'
|
||||
import * as protobuf from 'protobufjs'
|
||||
import { Base64Message } from './Base64Message';
|
||||
import { Decoder } from './Decoder';
|
||||
import { Base64Message } from './Base64Message'
|
||||
import { Decoder } from './Decoder'
|
||||
|
||||
const buffer = readFileSync(require.resolve('../../../../res/sparkplug_b.proto'));
|
||||
const buffer = readFileSync(require.resolve('../../../../res/sparkplug_b.proto'))
|
||||
const root = protobuf.parse(buffer.toString()).root
|
||||
export let SparkplugPayload = root.lookupType('com.cirruslink.sparkplug.protobuf.Payload')
|
||||
|
||||
@@ -11,14 +11,12 @@ export const SparkplugDecoder = {
|
||||
decode(input: Buffer): Base64Message | undefined {
|
||||
try {
|
||||
let message = Base64Message.fromString(
|
||||
JSON.stringify(
|
||||
SparkplugPayload.toObject(SparkplugPayload.decode(new Uint8Array(input)))
|
||||
)
|
||||
JSON.stringify(SparkplugPayload.toObject(SparkplugPayload.decode(new Uint8Array(input))))
|
||||
)
|
||||
message.decoder = Decoder.SPARKPLUG
|
||||
return message
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user