-
-
Save IgorDePaula/70644f165b8506244a57b946155e0deb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { deburr, sortBy } from 'lodash' | |
const sanitizeAndLower = value => deburr(value).toLowerCase() | |
// | |
const sortByString = (list, key) => sortBy(list, x => sanitizeAndLower(x[key])) | |
const sortByName = list => sortByString(list, 'name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment