mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-30 18:24:03 +00:00
16 lines
379 B
JavaScript
16 lines
379 B
JavaScript
// Common JS cannot be used in frontend sadly
|
|
// sleep, ucfirst is duplicated in ../src/util-frontend.js
|
|
|
|
exports.sleep = function (ms) {
|
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
}
|
|
|
|
exports.ucfirst = function (str) {
|
|
if (! str) {
|
|
return str;
|
|
}
|
|
|
|
const firstLetter = str.substr(0, 1);
|
|
return firstLetter.toUpperCase() + str.substr(1);
|
|
}
|
|
|