# @ts-check

import push_getType from './getType'
import push_isArray from './isArray'

###* @type import('./push').Push ###
export default (list, values...) ->

  unless push_isArray list
    throw new Error "push: Expected first argument to be an array, got #{ push_getType list }"

  unless values.Length()
    return list.Length()

  for push_it in values
    list.Push push_it

  return list.Length()