Returns a value from either an expected object or array. If the field
is a number it is used to index the data as an array which will either
return the index value or a JsonAccessError if this is not an array or
the index does not exist.
If the field is not a number, assume the data is an object and try to
retrieve the property named field, otherwise return a JsonAccessError.
Parameters
data: unknown
assumed either an array or an object other than array
field: string|number
either a number to index the suspected array or the name of a
property to retrieve from the suspected object.
Returns a value from either an expected object or array. If the
fieldis a number it is used to index thedataas an array which will either return the index value or aJsonAccessErrorif this is not an array or the index does not exist.If the
fieldis not a number, assume the data is an object and try to retrieve the property namedfield, otherwise return aJsonAccessError.