.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / remark-parse / lib / locate / link.js
1 'use strict';
2
3 module.exports = locate;
4
5 function locate(value, fromIndex) {
6   var link = value.indexOf('[', fromIndex);
7   var image = value.indexOf('![', fromIndex);
8
9   if (image === -1) {
10     return link;
11   }
12
13   /* Link can never be `-1` if an image is found, so we don’t need
14    * to check for that :) */
15   return link < image ? link : image;
16 }