0
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-28 21:32:46 +01:00
uptime-kuma/server/util.js
2021-07-09 14:14:03 +08:00

21 lines
333 B
JavaScript

/*
* Common functions - can be used in frontend or backend
*/
export function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export function ucfirst(str) {
if (! str) {
return str;
}
const firstLetter = str.substr(0, 1);
return firstLetter.toUpperCase() + str.substr(1);
}