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

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

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

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

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