import { ValueProcessorItem } from '..'
import { Action, Element } from '../../'
import helpers from '@/helpers'
import _ from 'lodash'

export default class CustomSelectProcessor implements ValueProcessorItem {
  public processValue(element: Element, index: number, rootState: any, rootGetters: any) {
    if (element.type === 'select') {
      if (element.options !== undefined && element.options.length === 1) {
        element.value = element.options[0].value
      }

      element.type = 'select'
    }

    return element
  }
}
