const mapArray = (arrayOfObject, mapFunctions) =>
  arrayOfObject.map((entity) => {
    const extra = {};
    const mapParamNames = Object.keys(mapFunctions);

    mapParamNames.forEach((param) => {
      extra[param] = mapFunctions[param](entity);
    });

    return { ...entity, ...extra };
  });

export default mapArray;
