Skip to content

Commit 087a8cb

Browse files
committed
Updated README.md
1 parent 72910dc commit 087a8cb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ require(['array-sort-by'], function(sortBy) {
8080
});
8181
```
8282

83-
See an example with RequireJS here: http://jsfiddle.net/FdKTn/66/
83+
See an example with RequireJS here: http://jsfiddle.net/FdKTn/69/
8484

8585
## Examples
8686

@@ -134,7 +134,7 @@ sortBy(arr, (s) => "desc:" + s);
134134
*/
135135
```
136136

137-
### Sorting DESC by @n, after ASC by @d (as Date)
137+
### Sorting DESC by @a, after ASC by @d (as Date)
138138

139139
```javascript
140140
let arr = [
@@ -180,7 +180,7 @@ sortBy(arr, (o) => "DESC:" + o.name.toUpperCase());
180180
*/
181181
```
182182

183-
### Sorting ASC by @name (ignore case sensitive), after DESC by @age, after ASC by @id
183+
### Sorting ASC by @name (ignore case sensitive), after DESC by @age, after ASC by @a
184184

185185
```javascript
186186
let arr = [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "array-sort-by",
3-
"version": "1.0.3",
3+
"version": "1.0.3a",
44
"description": "Sorts an array with multiple ordering criteria",
55
"author": "David Rivera <jherax@gmail.com>",
66
"main": "dist/sort-by.js",

src/sort-by.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ const isDesc = v => typeof v === 'string' && _DESC.test(v);
3535
*/
3636
function comparer(prev, next) {
3737
let asc = 1;
38+
// TODO: Add support for accented characters
39+
// See http://ow.ly/UvDD309zozK
40+
// e.g. return a.localeCompare(b);
3841
if (prev === next) return 0;
3942
if (isDesc(prev)) asc = -1;
4043
return (prev > next ? 1 : -1) * asc;

0 commit comments

Comments
 (0)