react-carousel-query
Version:
A infinite carousel component made with react that handles the pagination for you.
21 lines (16 loc) • 454 B
JavaScript
import jsParser from './parser-js';
import tsParser from './parser-ts';
import flowParser from './parser-flow';
function getParser(type) {
if (type === 'javascript' || /\.jsx?/.test(type) || !type) {
return jsParser;
}
if (type === 'typescript' || /\.tsx?/.test(type)) {
return tsParser;
}
if (type === 'flow') {
return flowParser;
}
throw new Error(`Parser of type "${type}" is not supported`);
}
export default getParser;