Replace .at(-1) with array[length-1] for ES2022 compatibility#187
Open
dcroote wants to merge 1 commit intoapi3dao:mainfrom
Open
Replace .at(-1) with array[length-1] for ES2022 compatibility#187dcroote wants to merge 1 commit intoapi3dao:mainfrom
dcroote wants to merge 1 commit intoapi3dao:mainfrom
Conversation
Co-authored-by: dcroote <13989647+dcroote@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #186
This was an easy one so gave it to Copilot and it looks good (original PR in my fork here but because I will delete the fork, copied below):
CI failing on TypeScript compilation due to
Array.at()method usage, which requires ES2022 lib support.Changes
attemptTimeoutMs.at(-1)withattemptTimeoutMs[attemptTimeoutMs.length - 1]insrc/index.ts:169Before:
After:
Both expressions access the last array element. The latter works with ES5+ without requiring lib configuration changes.