mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-10-25 01:30:48 +08:00
granular debug options
This commit is contained in:
12
lib/utils.js
12
lib/utils.js
@@ -15,18 +15,6 @@ class Utils
|
||||
return new Promise(res => setTimeout(res, msec))
|
||||
}
|
||||
|
||||
// Function to check if file exist and, optionally, if it is over a given size
|
||||
checkFile(file, sizeInBytes) {
|
||||
sizeInBytes = sizeInBytes ? sizeInBytes : 0
|
||||
if (!fs.existsSync(file)) {
|
||||
return false
|
||||
} else if (fs.statSync(file).size > sizeInBytes) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Return ISO time from epoch without milliseconds
|
||||
getISOTime(epoch) {
|
||||
return new Date(epoch).toISOString().slice(0,-5)+"Z"
|
||||
|
||||
Reference in New Issue
Block a user