generateUniqueName(name, isUniqueCb) → {string}
Obtain a unique name from the given one by testing it with the given
callback function.
The given "name", then "name2", "name3", "name4", ... "nameN" are all tried
one by one against the "isUniqueCb" function until it returns "true". Then
that name is considered unique and returned.
Parameters:
Name |
Type |
Description |
name |
string
|
Base name. |
isUniqueCb |
uniqueNameCallback
|
Callback function to test names for
uniqueness. |
Returns:
The resulting unique name in the form of "nameN" where
N = 2,3,4...
-
Type
-
string