mirror of
https://github.com/borbann-platform/end-of-semester-report.git
synced 2025-12-19 22:44:03 +01:00
1 line
1.0 KiB
Plaintext
1 line
1.0 KiB
Plaintext
{"version":3,"file":"index.cjs","sources":["../libs/delete-comments.ts"],"sourcesContent":["import * as Ast from \"@unified-latex/unified-latex-types\";\nimport { match } from \"@unified-latex/unified-latex-util-match\";\nimport { replaceNode } from \"@unified-latex/unified-latex-util-replace\";\n\n/**\n * Returns a new AST with all comments removed. Care is taken to preserve whitespace.\n * For example\n * ```\n * x%\n * y\n * ```\n * becomes `xy` but\n * ```\n * x %\n * y\n * ```\n * becomes `x y`\n */\nexport function deleteComments(ast: Ast.Ast) {\n return replaceNode(ast, (node) => {\n if (!match.comment(node)) {\n return;\n }\n\n if (node.leadingWhitespace) {\n return { type: \"whitespace\" };\n }\n\n return null;\n });\n}\n"],"names":["replaceNode","match"],"mappings":";;;;AAkBO,SAAS,eAAe,KAAc;AAClC,SAAAA,wBAAA,YAAY,KAAK,CAAC,SAAS;AAC9B,QAAI,CAACC,sBAAA,MAAM,QAAQ,IAAI,GAAG;AACtB;AAAA,IAAA;AAGJ,QAAI,KAAK,mBAAmB;AACjB,aAAA,EAAE,MAAM,aAAa;AAAA,IAAA;AAGzB,WAAA;AAAA,EAAA,CACV;AACL;;"} |