Formats a MalRequestOptions fields selector for the fields query
parameter: an array becomes the comma-separated string MyAnimeList expects,
a string passes through unchanged, and undefined stays undefined so
buildQueryString omits the parameter entirely.
Every MAL read and list-status write uses this helper to format the field
selector the same way.
Parameters
fields: string|readonlystring[]|undefined
The field selector from the request options, when one was given.
Returns string|undefined
The comma-separated selector string, or undefined when no selector was given.
Formats a MalRequestOptions
fieldsselector for thefieldsquery parameter: an array becomes the comma-separated string MyAnimeList expects, a string passes through unchanged, andundefinedstaysundefinedsobuildQueryStringomits the parameter entirely.Every MAL read and list-status write uses this helper to format the field selector the same way.