code: 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;
  }
docs: Check if given suffix is present.
  @private