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