This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
2020-11-01 22:46:04 +00:00

30 lines
456 B
JavaScript

'use strict'
module.exports = locate
var values = ['www.', 'http://', 'https://']
function locate(value, fromIndex) {
var min = -1
var index
var length
var position
if (!this.options.gfm) {
return min
}
length = values.length
index = -1
while (++index < length) {
position = value.indexOf(values[index], fromIndex)
if (position !== -1 && (min === -1 || position < min)) {
min = position
}
}
return min
}