src/utilities.js
function getBooleanFromRegisterQuery (str, regEx, offset) {
  let regExArr = str.match(regEx);
  if (regExArr) {
    const num = parseInt(str.charAt(regExArr.index + offset));
    if (!Number.isNaN(num)) {
      return Boolean(num);
    } else {
      throw new Error(k.OBCIErrorInvalidData);
    }
  } else {
    throw new Error(k.OBCIErrorMissingRegisterSetting);
  }
}
function getBooleanFromRegisterQuery (str, regEx, offset) {
  let regExArr = str.match(regEx);
  if (regExArr) {
    const num = parseInt(str.charAt(regExArr.index + offset));
    if (!Number.isNaN(num)) {
      return Boolean(num);
    } else {
      throw new Error(k.OBCIErrorInvalidData);
    }
  } else {
    throw new Error(k.OBCIErrorMissingRegisterSetting);
  }
}
function getBooleanFromRegisterQuery ( str , regEx , offset ) { let regExArr = str . match ( regEx ) ; if ( regExArr ) { const num = parseInt ( str . charAt ( regExArr . index + offset ) ) ; if ( ! Number . isNaN ( num ) ) { return Boolean ( num ) ; } else { throw new Error ( k . OBCIErrorInvalidData ) ; } } else { throw new Error ( k . OBCIErrorMissingRegisterSetting ) ; } }
Use reg ex to parse a `str` register query for a boolean `offset` from index. Throws errors
@param str {String} - The string to search
@param regEx {RegExp} - The key to match to
@param offset {Number} - The number of bytes to offset from the index of the reg ex hit
@returns {boolean} The converted and parsed value from `str`
Use reg ex to parse a str register query for a boolean offset from index . Throws errors