In this example the paramPackData is actually an object and you are trying to use it as an Object in line 21, but your param declaration on the top of the Function define that parameter as
{String}
and normally your decent IDE would complaint and you can see in the next Image..