mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
+tests for utils, fix UNAME_RE
This commit is contained in:
1 parent
54a57d3ca9
commit
d01034bca8
5 files changed
+187
-4
No files matched your search
@@ -152,7 +152,7 @@ export function parseTimeMS(str: string) {
|
||||
export function parseMemoryMB(str: string) {
|
||||
const match = MEMORY_RE.exec(str);
|
||||
if (!match) throw new Error(`${str} error parsing memory`);
|
||||
return Math.floor(parseFloat(match[1]) * MEMORY_UNITS[match[2]]);
|
||||
return Math.ceil(parseFloat(match[1]) * MEMORY_UNITS[match[2]]);
|
||||
}
|
||||
|
||||
export function isClass(obj: any, strict = false) {
|
||||
|
||||
Reference in new issue
Block a user