mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 01:48:12 +08:00
improve type handling for non-string annotation data (#465)
* improve type handling for non-string annotation data * improve clarity of code
This commit is contained in:
committed by
Charlotte Weaver
parent
2b5094665f
commit
138d30909a
@@ -1,7 +1,11 @@
|
||||
// jshint esversion: 6
|
||||
|
||||
// values is [ [optVal, optIdx], ...]
|
||||
// index is range array
|
||||
// return sorted index
|
||||
export default values =>
|
||||
Object.keys(values).sort((a, b) => {
|
||||
const textA = a.toUpperCase();
|
||||
const textB = b.toUpperCase();
|
||||
values.sort((a, b) => {
|
||||
const textA = String(a[0]).toUpperCase();
|
||||
const textB = String(b[0]).toUpperCase();
|
||||
return textA < textB ? -1 : textA > textB ? 1 : 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user