2021-04-20 21:06:27 +02:00
|
|
|
export const generateID = () => {
|
2021-05-03 09:31:09 +02:00
|
|
|
const rand = Math.random().toString(32).substring(2)
|
2021-04-20 21:06:27 +02:00
|
|
|
|
|
|
|
// Starts with a letter so that its a valid DOM ID
|
|
|
|
return `A${rand}`
|
|
|
|
}
|
2021-06-23 12:47:07 +02:00
|
|
|
|
|
|
|
export const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1)
|