2
YUI 3.10.3 (build 2fb5187)
3
Copyright 2013 Yahoo! Inc. All rights reserved.
4
Licensed under the BSD License.
5
http://yuilibrary.com/license/
8
YUI.add('arraysort', function (Y, NAME) {
11
Provides a case-insenstive comparator which can be used for array sorting.
17
ISVALUE = LANG.isValue,
18
ISSTRING = LANG.isString;
21
Provides a case-insenstive comparator which can be used for array sorting.
29
Comparator function for simple case-insensitive sorting of an array of
33
@param a {Object} First sort argument.
34
@param b {Object} Second sort argument.
35
@param desc {Boolean} `true` if sort direction is descending, `false` if
36
sort direction is ascending.
37
@return {Boolean} -1 when a < b. 0 when a == b. 1 when a > b.
39
compare: function(a, b, desc) {
48
else if(!ISVALUE(b)) {
59
return (desc) ? 1 : -1;
62
return (desc) ? -1 : 1;
72
}, '3.10.3', {"requires": ["yui-base"]});