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 and either
the value is returned or a JsonAccessError.
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 and either the value is returned or aJsonAccessError.If the
fieldis not a number, assume the data is an object and try to retrieve the property namedfield, otherwise return aJsonAccessError.