src/common/mapper.js
function singleToMulti(mapping) {
  const newMapping = {};
  Object.entries(mapping.mapping).forEach(m => {
    newMapping[m[0]] = [m[1]];
  });
  return {
    created: mapping.created,
    fields: [mapping.field],
    key: mapping.key,
    mapping: newMapping
  };
}
function singleToMulti(mapping) {
  const newMapping = {};
  Object.entries(mapping.mapping).forEach(m => {
    newMapping[m[0]] = [m[1]];
  });
  return {
    created: mapping.created,
    fields: [mapping.field],
    key: mapping.key,
    mapping: newMapping
  };
}
function singleToMulti ( mapping ) { const newMapping = { } ; Object . entries ( mapping . mapping ) . forEach ( m => { newMapping [ m [ 0 ] ] = [ m [ 1 ] ] ; } ) ; return { created : mapping . created , fields : [ mapping . field ] , key : mapping . key , mapping : newMapping } ; }
Convert single field mapping to multi field mapping
@param {object} mapping - single field mapping
@return {object} multi field mapping
Convert single field mapping to multi field mapping