.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / remark-stringify / lib / macro / one.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/remark-stringify/lib/macro/one.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/remark-stringify/lib/macro/one.js
new file mode 100644 (file)
index 0000000..f6a5d4a
--- /dev/null
@@ -0,0 +1,21 @@
+'use strict';
+
+module.exports = one;
+
+function one(node, parent) {
+  var self = this;
+  var visitors = self.visitors;
+
+  /* Fail on unknown nodes. */
+  if (typeof visitors[node.type] !== 'function') {
+    self.file.fail(
+      new Error(
+        'Missing compiler for node of type `' +
+        node.type + '`: `' + node + '`'
+      ),
+      node
+    );
+  }
+
+  return visitors[node.type].call(self, node, parent);
+}