You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/src/parse/memparse.js

9 lines
393 B
JavaScript

"use strict";
const parseIECBytes = require("./bytes/iec");
/* NOTE: This parsing module is for a special case; values that are normally handled using the Linux kernel's `memparse` function (which parses memory suffixes like K, M, G, etc.) but that do *not* semantically represent bytes. */
module.exports = function parseMemparseValue(value) {
return parseIECBytes(value).toB().amount;
};