constructor(str, i, ignoreCase) {
    this.s = ignoreCase ? str.toLowerCase() : str;
    this.i = !!ignoreCase; // must be boolean to ensure test() returns boolean
    this.cmp = i < 0 ? '' : (i && 'startsWith' || 'endsWith');
  }
For strings without wildcards/tld it's 1.5x faster and much more memory-efficient than RegExp