function normalizeOutput(values, options) {
  if (options.raw) { return values; }
  /** @type {Array<any>} */
  const result = [];
  /** @type {Array<any>|null} */
  let previous = null;
  let current = result;
  values.forEach((packet) => {
    if (packet.type === 'openBracket') {
      previous = current;
      current = [];
      previous.push(current);
    }
    if (packet.type === 'data') {
      current.push(packet.data);
    }
    if (packet.type === 'closeBracket') {
      current = /** @type {Array<any>} */ (previous);
    }
  });
  if (result.length === 1) {
    return result[0];
  }
  return result;
}
@param {Array<IP>} values
@param {AsCallbackOptions} options
@returns {Array<any>}