_validateMessageSeq (msg = []) {
    if (!this._seqAudit) return null
    if (!Array.isArray(msg)) return null
    if (msg.length === 0) return null

    // The auth sequence # is the last value in channel 0 non-heartbeat packets.
    const authSeq = msg[0] === 0 && msg[1] !== 'hb'
      ? msg[msg.length - 1]
      : NaN

    // *-req packets don't include public seq numbers
    if (`${(msg[2] || [])[1] || ''}`.slice(-4) !== '-req') {
      // All other packets provide a public sequence # as the last value. For chan
      // 0 packets, these are included as the 2nd to last value
      const seq = (
        (msg[0] === 0) &&
        (msg[1] !== 'hb') &&
        !(msg[1] === 'n' && ((msg[2] || [])[1] || '').slice(-4) === '-req')
      )
        ? msg[msg.length - 2]
        : msg[msg.length - 1]

      if (!_isFinite(seq)) return null

      if (this._lastPubSeq === -1) { // first pub seq received
        this._lastPubSeq = seq
        return null
      }

      if (seq !== this._lastPubSeq + 1) { // check pub seq
        return new Error(`invalid pub seq #; last ${this._lastPubSeq}, got ${seq}`)
      }

      this._lastPubSeq = seq
    }

    if (!_isFinite(authSeq)) return null
    if (authSeq === 0) return null // still syncing

    // notifications don't advance seq
    if (msg[1] === 'n') {
      return authSeq !== this._lastAuthSeq
        ? new Error(
          `invalid auth seq #, expected no advancement but got ${authSeq}`
        )
        : null
    }

    if (authSeq === this._lastAuthSeq) {
      return new Error(
        `expected auth seq # advancement but got same seq: ${authSeq}`
      )
    }

    // check
    if (this._lastAuthSeq !== -1 && authSeq !== this._lastAuthSeq + 1) {
      return new Error(
        `invalid auth seq #; last ${this._lastAuthSeq}, got ${authSeq}`
      )
    }

    this._lastAuthSeq = authSeq
    return null
  }
Returns an error if the message has an invalid (out of order) sequence #
The last-seen sequence #s are updated internally.

@param {Array} msg - incoming message
@returns {Error} err - null if no error or sequencing not enabled
@private