Returning multivalued attributes (such as member)?
Noticed that when I query a group for the member attribute, the member attribute is returned as a string if there is only one member, and as an array if there is more than one member - meaning I have to handle this in my code. Wondering if this a common expected pattern? I am guessing that ldapjs doesnt know apriori whether it will get a single value or multiple values back.
Yes, that's is the expected behavior. It is inconvenient at times, but changing the API would likely incur heavy breakage for a large number of users.
Looking over the code again, there might be a pretty easy way to expose what you're looking for. I'll work on it later this evening.
👋
On February 22, 2023, we released version 3 of this library. As a result, we are closing this issue/pull request.
Please see issue #839 for more information, including how to proceed if you feel this closure is in error.