UNPKG

array-sort-by

Version:

Sorts an array and allows specify multiple sorting criteria

11 lines (8 loc) 294 B
import test from 'ava'; import sortBy from '../dist/sort-by.min'; test('Sorting ASC: strings', async (t) => { const arr = ['único', 'cosas', 'Árbol', 'fútbol', 'algo']; const expected = ['algo', 'Árbol', 'cosas', 'fútbol', 'único']; sortBy(arr); t.deepEqual(arr, expected); });