// eslint-disable-next-line consistent-return
function toMap(collection) {
  if (collection instanceof Map) {
    return collection;
  } else if (collection instanceof Array) {
    return new Map(collection);
  } else if (typeof collection === 'object') {
    return new Map(Object.entries(collection));
  }

  throw new Error('No collection');
}

export default toMap;

@@ -1,8 +1,152 @@
+/**%0A * @typedef %7B(Map.%3Cany, any%3E%7CArray.%3Cany, any%3E%5B%5D%7Cobject)%7D toMapArg%0A */%0A%0A/**%0A * @param %7BtoMapArg%7D collection%0A * @returns %7BMap.%3Cany, any%3E%7D%0A */%0A
 // eslin

Add JSDoc comment for utlis/to-map.