src/parser.js
function makeConcat(chunkType) {
	switch (chunkType) {
	case BUFFER:
		return (a, b) => Buffer.concat([a, b]);
	default:
		return (a, b) => {
			// console.log('[%d, %d]', a.length, b.length);
			const t = new Uint8Array(a.length + b.length);
			t.set(a);
			t.set(b, a.length);
			// console.log('%d: %s', t.length, new Buffer(t).toString('utf8'));
			return t;
		};
	}
}
function makeConcat(chunkType) {
	switch (chunkType) {
	case BUFFER:
		return (a, b) => Buffer.concat([a, b]);
	default:
		return (a, b) => {
			// console.log('[%d, %d]', a.length, b.length);
			const t = new Uint8Array(a.length + b.length);
			t.set(a);
			t.set(b, a.length);
			// console.log('%d: %s', t.length, new Buffer(t).toString('utf8'));
			return t;
		};
	}
}
function makeConcat ( chunkType ) { switch ( chunkType ) { case BUFFER : return ( a , b ) => Buffer . concat ( [ a , b ] ) ; default : return ( a , b ) => { // console.log('[%d, %d]', a.length, b.length); const t = new Uint8Array ( a . length + b . length ) ; t . set ( a ) ; t . set ( b , a . length ) ; // console.log('%d: %s', t.length, new Buffer(t).toString('utf8')); return t ; } ; } }
Makes function to concat two byte chunks.
@param  {Boolean} [chunkType] Specifies type of input chunks.
@return {Function} The function to concat two byte chunks.
Makes function to concat two byte chunks .