const ALLOW_SET_SELECTION_RANGE = ['text', 'search', 'URL', 'tel', 'password']

export const selectAll = (control) => {
  if (ALLOW_SET_SELECTION_RANGE.includes(control.type)) {
    control.setSelectionRange(0, control.value.length)
  }
}

export const selectAll = (control) => {
  if (control.setSelectionRange) {
    control.setSelectionRange(0, control.value.length)
  }
}

Use duck typing in selectAll() helper
refactor: Use duck typing in selectAll() helper
