function checkCustomConditional(component, custom, row, data, form, variable, onError, instance) {
  if (typeof custom === 'string') {
    custom = `var ${variable} = true; ${custom}; return ${variable};`;
  }
  const value = (instance && instance.evaluate) ?
    instance.evaluate(custom, { row, data, form }) :
    evaluate(custom, { row, data, form });
  if (value === null) {
    return onError;
  }
  return value;
}
Check custom javascript conditional.
@param {import('@formio/core').Component} component - The component to check for the conditional.
@param {string} custom - The custom conditional string to evaluate.
@param {*} row - The row data for the component.
@param {*} data - The full submission data.
@param {import('@formio/core').Form} form - The form object.
@param {string} variable - The variable name for the result of the custom conditional.
@param {*} onError - A custom return if there is an error or the value is null from the evaluation.
@param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
@returns {*} - The result of the evaulation.