FieldBody in Aerys

FieldBody extends Body is a class of which instances are returned by the BodyParser.

It provides (in addition to the inherited methods from Body) two functions.

defined(): Promise<bool>

Returns a boolean whether the field the FieldBody instance has been requested for, had been passed at all by the client.

This function is basically equivalent to a call to valid() before any consume() call.

getMetadata(): Promise<array<"filename" => string, "mime" => string>>

Returns a Promise to the metadata array, as defined by ParsedBody.