src/editor.js
function hasPrefix(text, prefix) {
  let exp = new RegExp(`^${prefix.pattern}`);
  let result = exp.test(text);

  if (prefix.antipattern) {
    let exp = new RegExp(`^${prefix.antipattern}`);
    result = result && !exp.test(text);
  }

  return result;
}
function hasPrefix(text, prefix) {
  let exp = new RegExp(`^${prefix.pattern}`);
  let result = exp.test(text);

  if (prefix.antipattern) {
    let exp = new RegExp(`^${prefix.antipattern}`);
    result = result && !exp.test(text);
  }

  return result;
}
function hasPrefix ( text , prefix ) { let exp = new RegExp ( ` ${ prefix . pattern } ` ) ; let result = exp . test ( text ) ; if ( prefix . antipattern ) { let exp = new RegExp ( ` ${ prefix . antipattern } ` ) ; result = result && ! exp . test ( text ) ; } return result ; }
Check if given prefix is present.
@private
Check if given prefix is present .