Sort menu items by number only, sold-out last
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,6 @@ function formatMenu(menu: ParsedMenu): string {
|
|||||||
|
|
||||||
const sorted = [...menu.items].sort((a, b) => {
|
const sorted = [...menu.items].sort((a, b) => {
|
||||||
if (a.inactive !== b.inactive) return a.inactive ? 1 : -1
|
if (a.inactive !== b.inactive) return a.inactive ? 1 : -1
|
||||||
if (a.price !== b.price) return a.price - b.price
|
|
||||||
const na = parseInt(a.name.match(/^(\d+)\./)?.[1] ?? "99", 10)
|
const na = parseInt(a.name.match(/^(\d+)\./)?.[1] ?? "99", 10)
|
||||||
const nb = parseInt(b.name.match(/^(\d+)\./)?.[1] ?? "99", 10)
|
const nb = parseInt(b.name.match(/^(\d+)\./)?.[1] ?? "99", 10)
|
||||||
return na - nb
|
return na - nb
|
||||||
|
|||||||
Reference in New Issue
Block a user