MCPcopy Create free account
hub / github.com/avoidwork/filesize.js / getBaseConfiguration

Function getBaseConfiguration

src/helpers.js:40–53  ·  view source on GitHub ↗
(standard, base)

Source from the content-addressed store, hash-verified

38 * @returns {Object} Configuration object
39 */
40export function getBaseConfiguration(standard, base) {
41 // Use cached lookup table for better performance
42 if (STANDARD_CONFIGS[standard]) {
43 return STANDARD_CONFIGS[standard];
44 }
45
46 // Base override
47 if (base === 2) {
48 return { isDecimal: false, ceil: 1024, actualStandard: IEC };
49 }
50
51 // Default
52 return { isDecimal: true, ceil: 1000, actualStandard: JEDEC };
53}
54
55/**
56 * Optimized zero value handling

Callers 2

filesizeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected