mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-26 14:38:11 +08:00
* improve type handling for non-string annotation data * improve clarity of code
12 lines
313 B
JavaScript
12 lines
313 B
JavaScript
// jshint esversion: 6
|
|
|
|
// values is [ [optVal, optIdx], ...]
|
|
// index is range array
|
|
// return sorted index
|
|
export default values =>
|
|
values.sort((a, b) => {
|
|
const textA = String(a[0]).toUpperCase();
|
|
const textB = String(b[0]).toUpperCase();
|
|
return textA < textB ? -1 : textA > textB ? 1 : 0;
|
|
});
|