Skip to content

Instantly share code, notes, and snippets.

@IgorDePaula
Forked from vinicius73/strings-order.js
Created April 6, 2017 13:38
Show Gist options
  • Save IgorDePaula/70644f165b8506244a57b946155e0deb to your computer and use it in GitHub Desktop.
Save IgorDePaula/70644f165b8506244a57b946155e0deb 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