Closed OR13 closed 4 years ago
servers can hack around this by returning a nested array, but that will lead to a response type of Object || Array || null... which is bad.
I think findConfig
only ever returns an object (which may be null
if no config is found). I don't think it ever returns an array -- there can be only one config for a given controller and reference ID. The findConfigs
call can return multiple configs, but it already always returns an array which may potentially be empty. However, I tend to think that this latter call should be changed to always return an object with an array underneath a configs
property (could be bikeshedded) to allow for other meta properties in the future.
@OR13 does the existing findConfigs
API suite your needs? https://github.com/digitalbazaar/edv-client/blob/master/EdvClient.js#L795
ahh, didn't realize that api existed. I will test, but it looks like this can be closed.
Great, closing.
https://github.com/digitalbazaar/edv-client/blob/master/EdvClient.js#L771
The client should probably always return an array... returning null creates an unnecessary type.
The client should NOT return an object or an array.