This commit is contained in:
Mohammad Mahdi Robatjazi 2025-05-02 00:01:07 +00:00 committed by GitHub
commit 7687a0ff9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,6 @@
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const MAX_UID = 1_000_000
const MILLISECONDS_MULTIPLIER = 1000 const MILLISECONDS_MULTIPLIER = 1000
const TRANSITION_END = 'transitionend' const TRANSITION_END = 'transitionend'
@ -36,9 +35,10 @@ const toType = object => {
* Public Util API * Public Util API
*/ */
let idCount = 0
const getUID = prefix => { const getUID = prefix => {
do { do {
prefix += Math.floor(Math.random() * MAX_UID) prefix += idCount++
} while (document.getElementById(prefix)) } while (document.getElementById(prefix))
return prefix return prefix