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

Sort shouldn't be case sensitive #27

Open
gricey432 opened this issue Feb 12, 2021 · 0 comments
Open

Sort shouldn't be case sensitive #27

gricey432 opened this issue Feb 12, 2021 · 0 comments

Comments

@gricey432
Copy link

Not sure if this is desired behaviour, but it seems a bit odd to me.

Source:

var Table = require('easy-table')

var data = [
    {name: "Amy", snack: 'Apple'},
    {name: "Bob", snack: 'apple'},
    {name: "Charles", snack: 'Banana'},
    {name: "Dana", snack: 'Apple'},
    {name: "Eric", snack: 'Zuchini'},
]

var t = new Table

data.forEach(function(r) {
    t.cell('Person', r.name)
    t.cell('Snack', r.snack)
    t.newRow()
})
t.sort(['Snack'])
console.log(t.toString())

Output:

Person   Snack
-------  -------
Amy      Apple
Dana     Apple
Charles  Banana
Eric     Zuchini
Bob      apple

Expected:

Person   Snack
-------  -------
Amy      Apple
Bob      apple
Dana     Apple
Charles  Banana
Eric     Zuchini
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

No branches or pull requests

1 participant