"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveGranularityInLabel = void 0;
const GRANULARITY_PATTERN = /\$\{([^}]+)\.granularity\}/g;
const resolveGranularityInLabel = (label, granularityMap) => {
    if (label === undefined)
        return undefined;
    if (Object.keys(granularityMap).length === 0)
        return label;
    return label.replaceAll(GRANULARITY_PATTERN, (match, fieldBaseId) => {
        const granularity = granularityMap[fieldBaseId];
        return granularity ? granularity.toLowerCase() : match;
    });
};
exports.resolveGranularityInLabel = resolveGranularityInLabel;
//# sourceMappingURL=bigNumber.js.map