lib/parser.js
function makeDecoder(chunkType) {
	if (chunkType === BUFFER) {
		return function (buf) {
			return buf.toString('utf8');
		};
	}
	if (isnode) {
		return function (a) {
			return new Buffer(a).toString('utf8');
		};
	}
	var decoder = null;
	return function (buf) {
		if (!decoder) {
			decoder = new TextDecoder();
		}
		return decoder.decode(buf);
	};
}
function makeDecoder(chunkType) {
	if (chunkType === BUFFER) {
		return function (buf) {
			return buf.toString('utf8');
		};
	}
	if (isnode) {
		return function (a) {
			return new Buffer(a).toString('utf8');
		};
	}
	var decoder = null;
	return function (buf) {
		if (!decoder) {
			decoder = new TextDecoder();
		}
		return decoder.decode(buf);
	};
}
function makeDecoder ( chunkType ) { if ( chunkType === BUFFER ) { return function ( buf ) { return buf . toString ( 'utf8' ) ; } ; } if ( isnode ) { return function ( a ) { return new Buffer ( a ) . toString ( 'utf8' ) ; } ; } var decoder = null ; return function ( buf ) { if ( ! decoder ) { decoder = new TextDecoder ( ) ; } return decoder . decode ( buf ) ; } ; }
Makes UTF8 decoding function.
@param  {Boolean} [chunkType] Specifies type of input chunks.
@return {Function} The function to decode byte chunks.
Makes UTF8 decoding function .