lib/parser.js
/**
* FUNCTION: parser( extname[, fcn] )
*	If provided a parser, sets the parser assigned to a specified filename extension. Otherwise, returns a parser for the provided extension.
*
* @param {String} extname - filename extension
* @param {Function} [fcn] - parser
* @returns {Function|Null|Void} parser, null, or undefined
*/
parser( extname[, fcn] )
If provided a parser, sets the parser assigned to a specified filename extension. Otherwise, returns a parser for the provided extension.
parser ( extname [ fcn ] ) If provided a parser sets the parser assigned to a specified filename extension . Otherwise returns a parser for the provided extension .
function parser( extname, fcn ) {
	var ext = extname,
		f;
	if ( !isString( ext ) ) {
		throw new TypeError( 'invalid input argument. Extension argument must be a primitive string. Value: `' + ext + '`.' );
	}
	if ( ext[ 0 ] !== '.' ) {
		ext = '.' + ext;
	}
	ext = ext.toLowerCase();
	if ( arguments.length === 1 ) {
		f = parsers[ ext ];
		if ( f === void 0 ) {
			return null;
		}
		return f;
	}
	if ( !isFunction( fcn ) ) {
		throw new TypeError( 'invalid input argument. Parser argument must be a function. Value: `' + fcn + '`.' );
	}
	parsers[ ext ] = fcn;
} 
function parser ( extname , fcn ) { var ext = extname , f ; if ( ! isString ( ext ) ) { throw new TypeError ( 'invalid input argument. Extension argument must be a primitive string. Value: `' + ext + '`.' ) ; } if ( ext [ 0 ] !== '.' ) { ext = '.' + ext ; } ext = ext . toLowerCase ( ) ; if ( arguments . length === 1 ) { f = parsers [ ext ] ; if ( f === void 0 ) { return null ; } return f ; } if ( ! isFunction ( fcn ) ) { throw new TypeError ( 'invalid input argument. Parser argument must be a function. Value: `' + fcn + '`.' ) ; } parsers [ ext ] = fcn ; }
FUNCTION: parser( extname[, fcn] )
If provided a parser, sets the parser assigned to a specified filename extension.
FUNCTION : parser ( extname [ fcn ] ) If provided a parser sets the parser assigned to a specified filename extension .
// end FUNCTION parser()