lib/helper.js
function parseHeader(value, name){
	// Throw error if value is not array or string
	if(value && (!utils.isArray(value) && !utils.isString(value))){
		throw new Error(`Default Header for "${name}" must be Array or String`);
	}

	// In case when no error was threw, check if value is array
	// Set all values to UpperCase and join the values into a string
	else if(utils.isArray(value)){
		// Capitalize each string in the array
		value.forEach((element, index) => {
			var stringParts = element.split("-");
			var arr = [];

			stringParts.forEach((e, i) => {
				arr.push(firstUpperCase(e));
			});

			value[index] = arr.join("-");
		});

		value = value.join(", ");
	}

	return value;
}
function parseHeader(value, name){
	// Throw error if value is not array or string
	if(value && (!utils.isArray(value) && !utils.isString(value))){
		throw new Error(`Default Header for "${name}" must be Array or String`);
	}

	// In case when no error was threw, check if value is array
	// Set all values to UpperCase and join the values into a string
	else if(utils.isArray(value)){
		// Capitalize each string in the array
		value.forEach((element, index) => {
			var stringParts = element.split("-");
			var arr = [];

			stringParts.forEach((e, i) => {
				arr.push(firstUpperCase(e));
			});

			value[index] = arr.join("-");
		});

		value = value.join(", ");
	}

	return value;
}
function parseHeader ( value , name ) { // Throw error if value is not array or string if ( value && ( ! utils . isArray ( value ) && ! utils . isString ( value ) ) ) { throw new Error ( ` ${ name } ` ) ; } // In case when no error was threw, check if value is array // Set all values to UpperCase and join the values into a string else if ( utils . isArray ( value ) ) { // Capitalize each string in the array value . forEach ( ( element , index ) => { var stringParts = element . split ( "-" ) ; var arr = [ ] ; stringParts . forEach ( ( e , i ) => { arr . push ( firstUpperCase ( e ) ) ; } ) ; value [ index ] = arr . join ( "-" ) ; } ) ; value = value . join ( ", " ) ; } return value ; }
Parses the value for header data in response

@param  {String|Array} value The value of the data to be parsed for the header
@param  {String}       name  The name of the header that is going to be parsed
@return {String}             The parsed value for the header
Parses the value for header data in response