Skip to content

Commit

Permalink
fix: sort
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Feb 14, 2024
1 parent d750497 commit 5fd8213
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dev/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ export function parseButtons(metaTags: readonly HTMLMetaElement[]) {
} as FrameButton)
}

return buttons.toSorted((a, b) => a.index - b.index)
// Using `sort` over `toSorted` for Node.js < 20 compatibility (ie. Vercel default).
buttons.sort((a, b) => a.index - b.index)

return buttons
}

export function validateButtons(buttons: readonly FrameButton[]) {
Expand Down

0 comments on commit 5fd8213

Please sign in to comment.