INNER CODE UNIT · TypeScript
parseContentSync
pgilad/leasot · src/cli/cli.ts:28
const parseContentSync = async (content: string, options: ProgramArgs, filename?: string): Promise<TodoComment[]> => {
const extension = getFiletype(options.filetype, filename);
associateExtWithParser(options.associateParser);
if (!isExtensionSupported(extension)) {
if (options.skipUnsupported) {
return [];
}
console.log(logSymbols.error, `Filetype ${extension} is unsupported.`);
process.exit(1);
}
const config: ParseConfig = {
customTags: options.tags,
extension: extension,
filename: filename,
withInlineFiles: options.inlineFiles,