{"version":3,"file":"index.cjs","names":[],"sources":["../libs/delete-comments.ts","../index.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","export * from \"./libs/delete-comments\";\n\n// NOTE: The docstring comment must be the last item in the index.ts file!\n/**\n * ## What is this?\n *\n * Functions to help modify comments in a `unified-latex` Abstract Syntax Tree (AST).\n *\n * ## When should I use this?\n *\n * If you want to process comments in a `unified-latex` AST.\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,eAAe,KAAc;AACzC,SAAA,GAAA,0CAAA,aAAmB,MAAM,SAAS;AAC9B,MAAI,CAAC,wCAAA,MAAM,QAAQ,KAAK,CACpB;AAGJ,MAAI,KAAK,kBACL,QAAO,EAAE,MAAM,cAAc;AAGjC,SAAO;GACT"}