const GRANULARITY_PATTERN = /\$\{([^}]+)\.granularity\}/g;
export 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;
    });
};
//# sourceMappingURL=bigNumber.js.map