Merge pull request #8481 from gberaudo/expose_some_internal_functions
Expose some internal functions
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user