function generateLocaleCurrencies(localeData, baseCurrencies) {
  const currenciesData = localeData.main('numbers/currencies');
  const currencies = {};
  Object.keys(currenciesData).forEach(code => {
    let symbolsArray = [];
    const symbol = currenciesData[code].symbol;
    const symbolNarrow = currenciesData[code]['symbol-alt-narrow'];
    if (symbol && symbol !== code) {
      symbolsArray.push(symbol);
    }
    if (symbolNarrow && symbolNarrow !== symbol) {
      if (symbolsArray.length > 0) {
        symbolsArray.push(symbolNarrow);
      } else {
        symbolsArray = [undefined, symbolNarrow];
      }
    }

    // if locale data are different, set the value
    if ((baseCurrencies[code] || []).toString() !== symbolsArray.toString()) {
      currencies[code] = symbolsArray;
    }
  });
  return currencies;
}
function generateLocaleCurrencies(localeData, baseCurrencies) {
  const currenciesData = localeData.main('numbers/currencies');
  const currencies = {};
  Object.keys(currenciesData).forEach(code => {
    let symbolsArray = [];
    const symbol = currenciesData[code].symbol;
    const symbolNarrow = currenciesData[code]['symbol-alt-narrow'];
    if (symbol && symbol !== code) {
      symbolsArray.push(symbol);
    }
    if (symbolNarrow && symbolNarrow !== symbol) {
      if (symbolsArray.length > 0) {
        symbolsArray.push(symbolNarrow);
      } else {
        symbolsArray = [undefined, symbolNarrow];
      }
    }

    // if locale data are different, set the value
    if ((baseCurrencies[code] || []).toString() !== symbolsArray.toString()) {
      currencies[code] = symbolsArray;
    }
  });
  return currencies;
}
function generateLocaleCurrencies ( localeData , baseCurrencies ) { const currenciesData = localeData . main ( 'numbers/currencies' ) ; const currencies = { } ; Object . keys ( currenciesData ) . forEach ( code => { let symbolsArray = [ ] ; const symbol = currenciesData [ code ] . symbol ; const symbolNarrow = currenciesData [ code ] [ 'symbol-alt-narrow' ] ; if ( symbol && symbol !== code ) { symbolsArray . push ( symbol ) ; } if ( symbolNarrow && symbolNarrow !== symbol ) { if ( symbolsArray . length > 0 ) { symbolsArray . push ( symbolNarrow ) ; } else { symbolsArray = [ undefined , symbolNarrow ] ; } } // if locale data are different, set the value if ( ( baseCurrencies [ code ] || [ ] ) . toString ( ) !== symbolsArray . toString ( ) ) { currencies [ code ] = symbolsArray ; } } ) ; return currencies ; }
To minimize the file even more, we only output the differences compared to the base currency
To minimize the file even more we only output the differences compared to the base currency
Generate the currencies for a locale