(str, regex, fromIndex)
| 249 | // Hack to use a regex with lastIndexOf. |
| 250 | // Inspired by https://stackoverflow.com/a/21420210 |
| 251 | function lastIndexOfRegex(str, regex, fromIndex) { |
| 252 | const myStr = fromIndex ? str.substring(0, fromIndex) : str |
| 253 | const match = myStr.match(regex) |
| 254 | |
| 255 | return match ? myStr.lastIndexOf(match[match.length - 1]) : -1 |
| 256 | } |
| 257 | |
| 258 | // Checks if a conditional is necessary given all the supported versions and the arguments in a conditional |
| 259 | // If all supported versions show up in the arguments, it's not necessary! Additionally, builds in support |
no outgoing calls
no test coverage detected