Skip to content

Commit

Permalink
fix: node 14 compatibility (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
godky committed Feb 19, 2024
1 parent 543c19d commit 0dcf84f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function first(arr) {
}

export function last(arr) {
return arr.length > 0 ? arr.at(-1) : null;
return arr.length > 0 ? arr[arr.length - 1] : null;

Check failure on line 8 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / ci

Prefer `.at(…)` over `[….length - index]`
}

export function startCase(str) {
Expand Down

0 comments on commit 0dcf84f

Please sign in to comment.