1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2025-01-26 03:52:28 +02:00

17 lines
379 B
JavaScript
Raw Normal View History

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