leasot
Version:
Parse and output TODOs and FIXMEs from comments in your files
11 lines (10 loc) • 412 B
JavaScript
import { getRegex } from '../utils/index.js';
import { extractSingleLineComments } from '../utils/comments.js';
const parserFactory = ({ customTags }) => {
const regex = getRegex(customTags);
const lineCommentRegex = new RegExp(`^\\s*;+${regex}$`, 'ig');
return (contents, file) => {
return extractSingleLineComments(contents, file, lineCommentRegex);
};
};
export default parserFactory;