interpolateErrors = (component, errors, interpolateFn) => {
 return errors.map((error) => {
    error.component = component;
    const { errorKeyOrMessage, context } = error;
    const toInterpolate = component.errors && component.errors[errorKeyOrMessage] ? component.errors[errorKeyOrMessage] : errorKeyOrMessage;
    return { ...error, message: unescapeHTML(interpolateFn(toInterpolate, context)), context: { ...context } };
  });
}
Interpolates @formio/core errors so that they are compatible with the renderer
@param {Component} component - The component to interpolate the errors for
@param {FieldError[]} errors - The errors to interpolate
@param {Function} interpolateFn - The interpolation function
@returns {[]} - The interpolated errors