function calculateSvgDimensions(svg) {
  try {
    const { width, height } = new Resvg(svg, {
      logLevel: 'error',
      font: {
        loadSystemFonts: false // It will be faster to disable loading system fonts.
      }
    });

    return { width, height };
  } catch (error) {
    throw new DimensionsCalculationError(error);
  }
}
Calculate an SVG rendered dimensions.

@param {string} svg       svg
@returns {Dimension}      dimension