UNPKG

leasot

Version:

Parse and output TODOs and FIXMEs from comments in your files

11 lines (10 loc) 406 B
import { getRegex } from '../utils/index.js'; import { extractSingleLineComments } from '../utils/comments.js'; const parserFactory = ({ customTags }) => { const regex = getRegex(customTags); const commentsRegex = new RegExp(`^\\s*#${regex}$`, 'mig'); return (contents, file) => { return extractSingleLineComments(contents, file, commentsRegex); }; }; export default parserFactory;