chore: update deps (#869)

This commit is contained in:
Vasco Santos
2021-01-27 09:45:31 +01:00
committed by GitHub
parent 748b552876
commit 037c965a67
10 changed files with 57 additions and 49 deletions

View File

@ -63,9 +63,10 @@ module.exports.decodeV1PSK = (pskBuffer) => {
const metadata = uint8ArrayToString(pskBuffer).split(/(?:\r\n|\r|\n)/g)
const pskTag = metadata.shift()
const codec = metadata.shift()
const psk = uint8ArrayFromString(metadata.shift(), 'base16')
const pskString = metadata.shift()
const psk = pskString && uint8ArrayFromString(pskString, 'base16')
if (psk.byteLength !== KEY_LENGTH) {
if (!psk || psk.byteLength !== KEY_LENGTH) {
throw new Error(Errors.INVALID_PSK)
}