MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / parseAndConvert

Function parseAndConvert

web/pgadmin/static/js/utils.js:412–419  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

410
411export function compareSizeVals(val1, val2) {
412 const parseAndConvert = (val)=>{
413 try {
414 let [size, unit] = val.split(' ');
415 return convert(size).from(unit.toUpperCase()).to('B');
416 } catch {
417 return -1;
418 }
419 };
420 val1 = parseAndConvert(val1);
421 val2 = parseAndConvert(val2);
422 if(val1 > val2) return 1;

Callers 1

compareSizeValsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected