Problem/Motivation
In Drupal core, str.indexOf(val) or array.indexOf(val) compare with -1 are already replaced in #3439646: Some of string comparisons should use String.prototype.startsWith() or String.prototype.endsWith() or #3454079: Prefer to use Array.prototype.includes() for some of Array.prototype.indexOf(). Now str.inludes() and array.includes() can use modern browsers so module supporting Drupal 10+ can replace these code.
Proposed resolution
str.strpos(val) or array.indexOf(val) compare with -1 replaces like following list.
str.indexOf(val) !== -1replaces withstr.includes(val)array.indexOf(val) !== -1replaces witharray.includes(val)
Remaining tasks
TBD
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork charts-3549433
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tom kondaComment #4
tom kondaComment #5
nikathoneThanks @tom konda.
Comment #7
andileco commentedCommitted - thank you!