Zone 底座:排序函数
Methods
(static) sorterAsc(left, right, key) → {number}
「标准」Ux.sorterAsc
按字符串顺序排序。
Object.keys(groupedData).sort(Ux.sorterAsc).forEach(identifier => {
// 排序后的执行
});
Parameters:
Name | Type | Description |
---|---|---|
left |
Object | any | 左值。 |
right |
Object | any | 右值。 |
key |
String | 键值。 |
Returns:
排序因子
- Type
- number
(static) sorterAscD(left, right, key) → {number}
「标准」Ux.sorterAscD
按时间类型顺序排序。
Parameters:
Name | Type | Description |
---|---|---|
left |
any | 左值。 |
right |
any | 右值。 |
key |
String | 键值。 |
Returns:
排序因子
- Type
- number
(static) sorterAscDFn(key) → {function}
「标准」Ux.sorterAscDFn
「2阶」按时间类型顺序排序,生成函数。
Parameters:
Name | Type | Description |
---|---|---|
key |
String | 生成函数需要比较的字段 |
Returns:
排序函数。
- Type
- function
(static) sorterAscFn(key) → {function}
「标准」Ux.sorterAscFn
「2阶」按字符串顺序排序,生成函数。
Parameters:
Name | Type | Description |
---|---|---|
key |
String | 生成函数需要比较的字段 |
Returns:
排序函数。
- Type
- function
(static) sorterAscT(left, right, key) → {number}
「标准」Ux.sorterAscT
按任意类型顺序排序。
Parameters:
Name | Type | Description |
---|---|---|
left |
any | 左值。 |
right |
any | 右值。 |
key |
String | 键值。 |
Returns:
排序因子
- Type
- number
(static) sorterAscTFn(key) → {function}
「标准」Ux.sorterAscTFn
「2阶」按任意类型顺序排序,生成函数。
Parameters:
Name | Type | Description |
---|---|---|
key |
String | 生成函数需要比较的字段 |
Returns:
排序函数。
- Type
- function
(static) sorterDesc(left, right, key) → {number}
「标准」Ux.sorterDesc
按字符串逆序排序。
Parameters:
Name | Type | Description |
---|---|---|
left |
Object | any | 左值。 |
right |
Object | any | 右值。 |
key |
String | 键值。 |
Returns:
排序因子
- Type
- number
(static) sorterDescD(left, right, key) → {number}
「标准」Ux.sorterDescD
按时间类型逆序排序。
Parameters:
Name | Type | Description |
---|---|---|
left |
any | 左值。 |
right |
any | 右值。 |
key |
String | 键值。 |
Returns:
排序因子
- Type
- number
(static) sorterDescDFn(key) → {function}
##「标准」Ux.sorterDescDFn
「2阶」按时间类型逆序排序,生成函数。
Parameters:
Name | Type | Description |
---|---|---|
key |
String | 生成函数需要比较的字段 |
Returns:
排序函数。
- Type
- function
(static) sorterDescFn(key) → {function}
「标准」Ux.sorterDescFn
「2阶」按字符串逆序排序,生成函数。
Parameters:
Name | Type | Description |
---|---|---|
key |
String | 生成函数需要比较的字段 |
Returns:
排序函数。
- Type
- function
(static) sorterDescT(left, right, key) → {number}
「标准」Ux.sorterDescT
按任意类型逆序排序。
Parameters:
Name | Type | Description |
---|---|---|
left |
any | 左值。 |
right |
any | 右值。 |
key |
String | 键值。 |
Returns:
排序因子
- Type
- number
(static) sorterDescTFn(key) → {function}
「标准」Ux.sorterDescTFn
「2阶」按任意类型逆序排序,生成函数。
Parameters:
Name | Type | Description |
---|---|---|
key |
String | 生成函数需要比较的字段 |
Returns:
排序函数。
- Type
- function
(static) sorterObject(input) → {Object}
「标准」Ux.sorterObject
针对对象按照key
的字典序进行排序,主要用于打印过程中生成更容易分析的日志专用。
Parameters:
Name | Type | Description |
---|---|---|
input |
Object | 传入的对象Object的值。 |
Returns:
排序过后的对象。
- Type
- Object