lib/index.js
function resolveFormatter(formatter) {
	if (!formatter) return resolveFormatter('stylish');
	if (typeof formatter === 'function') return formatter;
	if (typeof formatter === 'string') {
		if (isModuleAvailable(formatter)) return require(formatter);
		if (isModuleAvailable(`./formatters/${formatter}`)) return require(`./formatters/${formatter}`);
		throw wrapError(new Error(`Could not resolve formatter: ${formatter}`));
	}
}
function resolveFormatter(formatter) {
	if (!formatter) return resolveFormatter('stylish');
	if (typeof formatter === 'function') return formatter;
	if (typeof formatter === 'string') {
		if (isModuleAvailable(formatter)) return require(formatter);
		if (isModuleAvailable(`./formatters/${formatter}`)) return require(`./formatters/${formatter}`);
		throw wrapError(new Error(`Could not resolve formatter: ${formatter}`));
	}
}
function resolveFormatter ( formatter ) { if ( ! formatter ) return resolveFormatter ( 'stylish' ) ; if ( typeof formatter === 'function' ) return formatter ; if ( typeof formatter === 'string' ) { if ( isModuleAvailable ( formatter ) ) return require ( formatter ) ; if ( isModuleAvailable ( ` ${ formatter } ` ) ) return require ( ` ${ formatter } ` ) ; throw wrapError ( new Error ( ` ${ formatter } ` ) ) ; } }
Resolves formatter.

@param {string|function} formatter - formatter
@returns {function} formatter function
Resolves formatter .