1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-05-09 19:20:04 +00:00
bramw_baserow/web-frontend/modules/core/utils/string.js
2020-03-31 14:15:27 +00:00

13 lines
414 B
JavaScript

export const uuid = function () {
let dt = new Date().getTime()
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (dt + Math.random() * 16) % 16 | 0
dt = Math.floor(dt / 16)
return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16)
})
return uuid
}
export const lowerCaseFirst = function (string) {
return string.charAt(0).toUpperCase() + string.slice(1)
}