Add rollup-plugin-minify-html-template-literals to node_modules
R=jacktfranklin@chromium.org
Bug: 1213034
Change-Id: I5da8225f60b53870a1c67d6b5d02a464c08f4eb2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2917088
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/node_modules/parse-literals/src/parseLiterals.js b/node_modules/parse-literals/src/parseLiterals.js
new file mode 100644
index 0000000..046e36b
--- /dev/null
+++ b/node_modules/parse-literals/src/parseLiterals.js
@@ -0,0 +1,30 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.parseLiterals = void 0;
+const typescript_1 = require("./strategies/typescript");
+function parseLiterals(source, options = {}) {
+ const strategy = {
+ ...typescript_1.default,
+ ...(options.strategy || {})
+ };
+ const literals = [];
+ const visitedTemplates = [];
+ strategy.walkNodes(strategy.getRootNode(source, options.fileName), node => {
+ if (strategy.isTaggedTemplate(node)) {
+ const template = strategy.getTaggedTemplateTemplate(node);
+ visitedTemplates.push(template);
+ literals.push({
+ tag: strategy.getTagText(node),
+ parts: strategy.getTemplateParts(template)
+ });
+ }
+ else if (strategy.isTemplate(node) && !visitedTemplates.includes(node)) {
+ literals.push({
+ parts: strategy.getTemplateParts(node)
+ });
+ }
+ });
+ return literals;
+}
+exports.parseLiterals = parseLiterals;
+//# sourceMappingURL=parseLiterals.js.map
\ No newline at end of file