mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-06 12:50:06 +01:00
🐛 Empty byte count now returns a warning symbol
This commit is contained in:
@@ -129,9 +129,18 @@ class ActivePhpInstallation {
|
|||||||
return "∞"
|
return "∞"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if value.isEmpty {
|
||||||
|
return "⚠️"
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the syntax is valid otherwise
|
// Check if the syntax is valid otherwise
|
||||||
let regex = try! NSRegularExpression(pattern: #"^([0-9]*)(K|M|G|)$"#, options: [])
|
let regex = try! NSRegularExpression(pattern: #"^([0-9]*)(K|M|G|)$"#, options: [])
|
||||||
let match = regex.matches(in: value, options: [], range: NSRange(location: 0, length: value.count)).first
|
|
||||||
|
let match = regex.matches(
|
||||||
|
in: value, options: [],
|
||||||
|
range: NSRange(location: 0, length: value.count)
|
||||||
|
).first
|
||||||
|
|
||||||
return (match == nil) ? "⚠️" : "\(value)B"
|
return (match == nil) ? "⚠️" : "\(value)B"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user