Skip to content

Instantly share code, notes, and snippets.

@vinicius73
Last active April 6, 2017 13:38
Show Gist options
  • Save vinicius73/6572dafef94724404b3644562633cbb8 to your computer and use it in GitHub Desktop.
Save vinicius73/6572dafef94724404b3644562633cbb8 to your computer and use it in GitHub Desktop.
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