(arr, item)
| 14223 | return filename |
| 14224 | } |
| 14225 | static getNextOrPrevious(arr, item) { |
| 14226 | const length = arr.length |
| 14227 | const index = arr.indexOf(item) |
| 14228 | if (length === 1) return undefined |
| 14229 | if (index === length - 1) return arr[index - 1] |
| 14230 | return arr[index + 1] |
| 14231 | } |
| 14232 | static toggle(currentValue, values) { |
| 14233 | const index = values.indexOf(currentValue) |
| 14234 | return index === -1 || index + 1 === values.length ? values[0] : values[index + 1] |