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

Function compareSizeVals

web/pgadmin/static/js/utils.js:411–424  ·  view source on GitHub ↗
(val1, val2)

Source from the content-addressed store, hash-verified

409}
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;
423 return (val1 < val2 ? -1 : 0);
424}
425
426export function calcFontSize(fontSize) {
427 if(fontSize) {

Callers

nothing calls this directly

Calls 1

parseAndConvertFunction · 0.70

Tested by

no test coverage detected