-
Notifications
You must be signed in to change notification settings - Fork 5
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
add by attribute sorting capability #5
Conversation
I've not updated the README.md... |
const sortFiles = currify((attr, order, array) => { | ||
const cmpCallbacks = { | ||
'numeric': (a, b) => (+a - +b), | ||
'default': (a, b) => (a > b ? 1 : -1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What difference between numeric
and default
?
break; | ||
default: | ||
order = 'asc'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe is better to use if
instead of switch
in this condition?
1 similar comment
Thank you :), merged as e51fa08. |
Landed in v4.1.0. |
Added ability to sort directories by date in v4.1.5. |
replace #2 because revised master was too different