Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vercel): sort valid widths before picking largest #472

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

harshjv
Copy link
Contributor

@harshjv harshjv commented Jan 9, 2022

Default .sort method converts elements into strings and then sorts them in ascending order.

Before

const validWidths = Object.values(sizes || {}).sort()
> [100, 1200, 150]

After

const validWidths = Object.values(sizes || {}).sort((a, b) => a - b)
> [100, 150, 1200]

@pi0 pi0 changed the title Fix sorting of screens values fix(vercel): fix sorting of screens values Jan 13, 2022
@pi0 pi0 changed the title fix(vercel): fix sorting of screens values fix(vercel): sort valid widths before picking largest Jan 13, 2022
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pi0 pi0 merged commit f4a408f into nuxt:main Jan 13, 2022
procrates pushed a commit to procrates/nuxt-image that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants