2021-07-16 18:51:28 +02:00
|
|
|
// Common JS cannot be used in frontend sadly
|
|
|
|
// sleep, ucfirst is duplicated in ../src/util-frontend.js
|
2021-07-01 15:47:14 +02:00
|
|
|
|
2021-07-15 19:44:51 +02:00
|
|
|
exports.sleep = function (ms) {
|
2021-06-25 15:55:49 +02:00
|
|
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
|
|
}
|
2021-06-29 10:06:20 +02:00
|
|
|
|
2021-07-15 19:44:51 +02:00
|
|
|
exports.ucfirst = function (str) {
|
2021-07-09 08:14:03 +02:00
|
|
|
if (! str) {
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2021-06-29 10:06:20 +02:00
|
|
|
const firstLetter = str.substr(0, 1);
|
|
|
|
return firstLetter.toUpperCase() + str.substr(1);
|
|
|
|
}
|
2021-06-30 20:02:54 +02:00
|
|
|
|