# @ts-check

import length_getType from './getType'
import length_isArray from './isArray'
import length_isObject from './isObject'
import length_isString from './isString'

###* @type import('./length').Length ###
export default (ipt) ->

  if length_isArray ipt then return ipt.Length()
  if length_isObject ipt then return ipt.Count()
  if length_isString ipt then return StrLen ipt

  throw new Error "length: invalid type '#{length_getType ipt}'"