You've already forked uptime-kuma
							
							
				mirror of
				https://github.com/louislam/uptime-kuma.git
				synced 2025-10-30 23:58:13 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			545 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			545 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Common JS cannot be used in frontend sadly
 | |
| // sleep, ucfirst is duplicated in ../src/util-frontend.js
 | |
| 
 | |
| exports.DOWN = 0;
 | |
| exports.UP = 1;
 | |
| exports.PENDING = 2;
 | |
| 
 | |
| 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);
 | |
| }
 | |
| 
 | |
| exports.debug = (msg) => {
 | |
|     if (process.env.NODE_ENV === "development") {
 | |
|         console.log(msg)
 | |
|     }
 | |
| }
 |