+tests for utils, fix UNAME_RE

This commit is contained in:
undefined committed 2020-08-11 00:09:44 +08:00
1 parent 54a57d3ca9
commit d01034bca8
5 files changed
+187 -4

No files matched your search

+1 -1
View File
@@ -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) {