summaryrefslogtreecommitdiff
path: root/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js')
-rw-r--r--tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js
new file mode 100644
index 0000000000..1f7c52931d
--- /dev/null
+++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js
@@ -0,0 +1,21 @@
+"use strict";
+
+exports.__esModule = true;
+exports.default = addComments;
+
+function addComments(node, type, comments) {
+ if (!comments || !node) return node;
+ var key = type + "Comments";
+
+ if (node[key]) {
+ if (type === "leading") {
+ node[key] = comments.concat(node[key]);
+ } else {
+ node[key] = node[key].concat(comments);
+ }
+ } else {
+ node[key] = comments;
+ }
+
+ return node;
+} \ No newline at end of file