|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
543 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * The base implementation of `_.sortBy` which uses `comparer` to define the
|
|---|
| 3 | * sort order of `array` and replaces criteria objects with their corresponding
|
|---|
| 4 | * values.
|
|---|
| 5 | *
|
|---|
| 6 | * @private
|
|---|
| 7 | * @param {Array} array The array to sort.
|
|---|
| 8 | * @param {Function} comparer The function to define sort order.
|
|---|
| 9 | * @returns {Array} Returns `array`.
|
|---|
| 10 | */
|
|---|
| 11 | function baseSortBy(array, comparer) {
|
|---|
| 12 | var length = array.length;
|
|---|
| 13 |
|
|---|
| 14 | array.sort(comparer);
|
|---|
| 15 | while (length--) {
|
|---|
| 16 | array[length] = array[length].value;
|
|---|
| 17 | }
|
|---|
| 18 | return array;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | module.exports = baseSortBy;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.