diff --git a/src/ol/array.js b/src/ol/array.js index 47dc5d0876..bb9796c096 100644 --- a/src/ol/array.js +++ b/src/ol/array.js @@ -194,8 +194,11 @@ export function equals(arr1, arr2) { /** + * Sort the passed array such that the relative order of equal elements is preverved. + * See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details. * @param {Array<*>} arr The array to sort (modifies original). - * @param {Function} compareFnc Comparison function. + * @param {!function(*, *): number} compareFnc Comparison function. + * @api */ export function stableSort(arr, compareFnc) { const length = arr.length; diff --git a/src/ol/util.js b/src/ol/util.js index beecbdc9fa..2eee713b3d 100644 --- a/src/ol/util.js +++ b/src/ol/util.js @@ -44,6 +44,7 @@ let uidCounter_ = 0; * * @param {Object} obj The object to get the unique ID for. * @return {number} The unique ID for the object. + * @api */ export function getUid(obj) { return obj.ol_uid || (obj.ol_uid = ++uidCounter_);