.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / remark-parse / lib / locate / url.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/remark-parse/lib/locate/url.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/remark-parse/lib/locate/url.js
new file mode 100644 (file)
index 0000000..59b63e2
--- /dev/null
@@ -0,0 +1,26 @@
+'use strict';
+
+module.exports = locate;
+
+var PROTOCOLS = ['https://', 'http://', 'mailto:'];
+
+function locate(value, fromIndex) {
+  var length = PROTOCOLS.length;
+  var index = -1;
+  var min = -1;
+  var position;
+
+  if (!this.options.gfm) {
+    return -1;
+  }
+
+  while (++index < length) {
+    position = value.indexOf(PROTOCOLS[index], fromIndex);
+
+    if (position !== -1 && (position < min || min === -1)) {
+      min = position;
+    }
+  }
+
+  return min;
+}