UNPKG

yaml-unist-parser

Version:

A YAML parser that produces output compatible with unist

10 lines (9 loc) 220 B
export function findLastCharIndex(text, from, regex) { for (let i = from; i >= 0; i--) { if (regex.test(text[i])) { return i; } } // istanbul ignore next return -1; }