CLI/argumentParser.js
function getFormat(formatString) {
	let format = formatString.toLowerCase();
	if(format == 'apa' || format == 'a') {
		return CitationCore.styles.apa;
	}
	else if(format == 'chicago' || format == 'c') {
		return CitationCore.styles.chicago;
	}
    else if(format == 'bibtexmisc' || format == 'bm') {
        return CitationCore.styles.bibtexMisc;
    }
    else if(format == 'bibtexsoftware' || format == 'bs'){
        return CitationCore.styles.biblatexSoftware;
    }
	throw new Error(formatString + ' is an unsuported citation format. Try "apa" or "chicago"');
}
function getFormat(formatString) {
	let format = formatString.toLowerCase();
	if(format == 'apa' || format == 'a') {
		return CitationCore.styles.apa;
	}
	else if(format == 'chicago' || format == 'c') {
		return CitationCore.styles.chicago;
	}
    else if(format == 'bibtexmisc' || format == 'bm') {
        return CitationCore.styles.bibtexMisc;
    }
    else if(format == 'bibtexsoftware' || format == 'bs'){
        return CitationCore.styles.biblatexSoftware;
    }
	throw new Error(formatString + ' is an unsuported citation format. Try "apa" or "chicago"');
}
function getFormat ( formatString ) { let format = formatString . toLowerCase ( ) ; if ( format == 'apa' || format == 'a' ) { return CitationCore . styles . apa ; } else if ( format == 'chicago' || format == 'c' ) { return CitationCore . styles . chicago ; } else if ( format == 'bibtexmisc' || format == 'bm' ) { return CitationCore . styles . bibtexMisc ; } else if ( format == 'bibtexsoftware' || format == 'bs' ) { return CitationCore . styles . biblatexSoftware ; } throw new Error ( formatString + ' is an unsuported citation format. Try "apa" or "chicago"' ) ; }
Determines the Formatter object from a string.
@param {string} formatString - The string representation of a format. For example c or 'chicago' will return the Chicago Formatter.
@return {Formatter} - The formatter for the given description.
@throws {Error} Will throw an error if a formatter is not found
Determines the Formatter object from a string .