import { TextareaProps } from './textarea.types'

/** Returns length of the initial textarea's value. */
export function getInitialCount(props: TextareaProps) {
  const { defaultValue, value } = props

  return defaultValue?.toString().length ?? value?.toString().length ?? 0
}
