forked from 0x2620/pandora
fix sort
This commit is contained in:
parent
f4bfe9294b
commit
e7ede6ade0
2 changed files with 6 additions and 3 deletions
|
|
@ -199,10 +199,10 @@ function sortBy(array, by, map) {
|
|||
while (ret == 0 && index < by.length) {
|
||||
key = by[index].key;
|
||||
aValue = getSortValue(
|
||||
map[key] ? map[key](a[key], a) : a[key]
|
||||
map && map[key] ? map[key](a[key], a) : a[key]
|
||||
);
|
||||
bValue = getSortValue(
|
||||
map[key] ? map[key](b[key], b) : b[key]
|
||||
map && map[key] ? map[key](b[key], b) : b[key]
|
||||
);
|
||||
if ((aValue === null) != (bValue === null)) {
|
||||
ret = aValue === null ? 1 : -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue