17 lines
390 B
JavaScript
17 lines
390 B
JavaScript
/**
|
|
* @public
|
|
* @param {string} type
|
|
* @return {string}
|
|
*/
|
|
export function getUName(list) {
|
|
var base = 1;
|
|
if (list) {
|
|
list.forEach(elem => {
|
|
if (elem.hasOwnProperty('name') && Number.isInteger(parseInt(elem.name)) && parseInt(elem.name) >= base) {
|
|
base = parseInt(elem.name) + 1;
|
|
}
|
|
});
|
|
}
|
|
return base.toString();
|
|
}
|