Simplifies the logic of getting the query and options from the overload params, making it explicit when query is overridden and when it's not.
Removes Partial from the type of options when it's the first parameter. This results in a type error when you provide a lone options object without a query key. For example: client.v2.search({ max_results: 1 }) is a type error now. However, the type error is long and hard to read. I'll restate my suggestion from the issue of just reverting to the original API which was clearer, though that would be a breaking change now.
Adds an additional test scenario for calling search with only an options object. This regrettably adds an additional 1.5 seconds to the runtime.
Issue: #430
Simplifies the logic of getting the query and options from the overload params, making it explicit when
query
is overridden and when it's not.Removes
Partial
from the type ofoptions
when it's the first parameter. This results in a type error when you provide a lone options object without aquery
key. For example:client.v2.search({ max_results: 1 })
is a type error now. However, the type error is long and hard to read. I'll restate my suggestion from the issue of just reverting to the original API which was clearer, though that would be a breaking change now.Adds an additional test scenario for calling search with only an options object. This regrettably adds an additional 1.5 seconds to the runtime.