Closed (fixed)
Project:
Charts
Version:
5.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2025 at 06:39 UTC
Updated:
5 Nov 2025 at 16:24 UTC
Jump to comment: Most recent
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.
str.strpos(val) or array.indexOf(val) compare with -1 replaces like following list.
str.indexOf(val) !== -1 replaces with str.includes(val)
array.indexOf(val) !== -1 replaces with array.includes(val)TBD
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!