function parseFormData (requestBody, trimFields) {
  if (!Array.isArray(requestBody[requestBody.mode])) {
    return '';
  }

  return requestBody[requestBody.mode].reduce((body, data) => {
    if (data.disabled) {
      return body;
    }
    if (data.type === 'file') {
      body += `request.AddFile("${sanitize(data.key, trimFields)}", "${sanitize(data.src, trimFields)}");\n`;
    }
    else {
      (!data.value) && (data.value = '');
      body += `request.AddParameter("${sanitize(data.key, trimFields)}", ` +
                `"${sanitize(data.value, trimFields)}");\n`;
    }

    return body;
  }, '');
}
/**
 * Parses body of request specific requests having form data
 *
 * @param {Object} requestBody - JSON object representing body of request
 * @param {Boolean} trimFields - indicates whether to trim fields of body
 * @returns {String} code snippet of csharp-restsharp for multipart formdata
 */
Parses body of request specific requests having form data
@param {Object} requestBody - JSON object representing body of request
@param {Boolean} trimFields - indicates whether to trim fields of body
@returns {String} code snippet of csharp-restsharp for multipart formdata
Parses body of request specific requests having form data @param { Object } requestBody - JSON object representing body of request @param { Boolean } trimFields - indicates whether to trim fields of body @returns { String } code snippet of csharp - restsharp for multipart formdata
function parseFormData (requestBody, trimFields) {
  if (!Array.isArray(requestBody[requestBody.mode])) {
    return '';
  }
  return requestBody[requestBody.mode].reduce((body, data) => {
    if (data.disabled) {
      return body;
    }
    if (data.type === 'file') {
      body += `request.AddFile("${sanitize(data.key, trimFields)}", "${sanitize(data.src, trimFields)}");\n`;
    }
    else {
      (!data.value) && (data.value = '');
      body += `request.AddParameter("${sanitize(data.key, trimFields)}", ` +
                `"${sanitize(data.value, trimFields)}");\n`;
    }
    return body;
  }, '');
}
function parseFormData ( requestBody , trimFields ) { if ( ! Array . isArray ( requestBody [ requestBody . mode ] ) ) { return '' ; } return requestBody [ requestBody . mode ] . reduce ( ( body , data ) => { if ( data . disabled ) { return body ; } if ( data . type === 'file' ) { body += ` ${ sanitize ( data . key , trimFields ) } ${ sanitize ( data . src , trimFields ) } \n ` ; } else { ( ! data . value ) && ( data . value = '' ) ; body += ` ${ sanitize ( data . key , trimFields ) } ` + ` ${ sanitize ( data . value , trimFields ) } \n ` ; } return body ; } , '' ) ; }
Parses body of request specific requests having form data
 @param {Object} requestBody - JSON object representing body of request
 @param {Boolean} trimFields - indicates whether to trim fields of body
 @returns {String} code snippet of csharp-restsharp for multipart formdata
Parses body of request specific requests having form data @param { Object } requestBody - JSON object representing body of request @param { Boolean } trimFields - indicates whether to trim fields of body @returns { String } code snippet of csharp - restsharp for multipart formdata