function formatArrayOfMaps(arrayOfMaps) {
  const result = [];
  for (let i = 0; i < arrayOfMaps.length; i++) {
    const map = arrayOfMaps[i];

    if (Object.getPrototypeOf(map.map) === Object.prototype) {  // Object map
      for (const key in map.map) {
        const tmp =
            key + ':' + map.map[key] + (map.context ? ':' + map.context : '');
        result.push(tmp);
      }
    } else if (
        typeof map.map.keys === 'function' &&
        typeof map.map.get === 'function') {  // MapLike
      for (const key of map.map.keys()) {
        const tmp = key + ':' + map.map.get(key) +
            (map.context ? ':' + map.context : '');
        result.push(tmp);
      }
    } else {
      throw new Error('Unknown input type for map: ' + String(map));
    }
  }
  return result.join(', ');
}
Helper function to return a formatted string representing an array of maps.