Merge pull request #8481 from gberaudo/expose_some_internal_functions

Expose some internal functions
This commit is contained in:
Frédéric Junod
2018-08-23 10:42:19 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -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;

View File

@@ -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_);