mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 07:14:04 +00:00
20 lines
341 B
JavaScript
20 lines
341 B
JavaScript
/*
|
|
* Common functions - can be used in frontend or backend
|
|
*/
|
|
|
|
|
|
|
|
|
|
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);
|
|
}
|
|
|