MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / parseByteString

Function parseByteString

test/e2e/helpers/memory-helpers.ts:281–293  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

279}
280
281function parseByteString(str: string): number {
282 const number = parseFloat(str);
283 if (str.endsWith('kB')) {
284 return number * 1000;
285 }
286 if (str.endsWith('MB')) {
287 return number * 1000 * 1000;
288 }
289 if (str.endsWith('GB')) {
290 return number * 1000 * 1000 * 1000;
291 }
292 return number;
293}
294
295async function getSizesFromRow(row: puppeteer.ElementHandle<Element>, devToolsPage: DevToolsPage) {
296 const numericData = await devToolsPage.$$('.numeric-column>.profile-multiple-values>span', row);

Callers 3

getSizesFromRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected