diff --git a/packages/kboot/src/util/usb/encode-command-option.ts b/packages/kboot/src/util/usb/encode-command-option.ts index 621269fa375..5f08c97e6b1 100644 --- a/packages/kboot/src/util/usb/encode-command-option.ts +++ b/packages/kboot/src/util/usb/encode-command-option.ts @@ -26,7 +26,7 @@ export const encodeCommandOption = (option: CommandOption): number[] => { ]; const placeholders = new Array(32 - payload.length) - .fill(0); + .fill(0) as number[]; return [...header, ...payload, ...placeholders]; }; diff --git a/packages/mcumgr/src/serial-peripheral.ts b/packages/mcumgr/src/serial-peripheral.ts index 9d30d35df7f..d6685942f59 100644 --- a/packages/mcumgr/src/serial-peripheral.ts +++ b/packages/mcumgr/src/serial-peripheral.ts @@ -79,7 +79,7 @@ export class SerialPeripheral implements Peripheral { const startTime = new Date().getTime(); while (true) { - const response = this.#serialPort.read(); + const response = this.#serialPort.read() as Buffer; logger('Read response: %o', response); let exit = false; diff --git a/packages/mcumgr/src/util/cbor.ts b/packages/mcumgr/src/util/cbor.ts index a3d84c68529..de281ebd357 100644 --- a/packages/mcumgr/src/util/cbor.ts +++ b/packages/mcumgr/src/util/cbor.ts @@ -289,7 +289,7 @@ export function decode(data: ArrayBuffer | SharedArrayBuffer, tagger?: Function, } } - function decodeItem() { + function decodeItem(): unknown { const initialByte = readUint8(); const majorType = initialByte >> 5; const additionalInformation = initialByte & 0x1f; @@ -366,7 +366,7 @@ export function decode(data: ArrayBuffer | SharedArrayBuffer, tagger?: Function, case 5: { const retObject = {}; for (i = 0; i < length || length < 0 && !readBreak(); ++i) { - const key = decodeItem(); + const key = decodeItem() as string | number; retObject[key] = decodeItem(); } return retObject;