Verified Commit c794a0e0 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3416898 by Tom Konda, Tirupati_Singh: Use String.prototype.includes()...

Issue #3416898 by Tom Konda, Tirupati_Singh: Use String.prototype.includes() instead of String.prototype.indexOf() where necessary
parent 4fa8f80b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@

    // Ensure that we have a valid URL by adding ? when no query parameter is
    // yet available, otherwise append using &.
    if (ajax.options.url.indexOf('?') === -1) {
    if (!ajax.options.url.includes('?')) {
      ajax.options.url += '?';
    } else {
      ajax.options.url += '&';
+1 −4
Original line number Diff line number Diff line
@@ -79,10 +79,7 @@

    const term = autocomplete.extractLastTerm(event.target.value);
    // Abort search if the first character is in firstCharacterBlacklist.
    if (
      term.length > 0 &&
      options.firstCharacterBlacklist.indexOf(term[0]) !== -1
    ) {
    if (term.length > 0 && options.firstCharacterBlacklist.includes(term[0])) {
      return false;
    }
    // Only search when the term is at least the minimum length.
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@
          // When doing a post request, you need non-null data. Otherwise a
          // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
          let uri = this.uri;
          if (uri.indexOf('?') === -1) {
          if (!uri.includes('?')) {
            uri += '?';
          } else {
            uri += '&';
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@
    )}`;
    $contextual.find('.contextual-links a').each(function () {
      const url = this.getAttribute('href');
      const glue = url.indexOf('?') === -1 ? '?' : '&';
      const glue = url.includes('?') ? '&' : '?';
      this.setAttribute('href', url + glue + destination);
    });

+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@
        }

        // The simple case: no wildcard in property value.
        if (propertyValue.indexOf('*') === -1) {
        if (!propertyValue.includes('*')) {
          if (
            universe.hasOwnProperty(tag) &&
            universe[tag].hasOwnProperty(key)
Loading