Provide accessor for SearchEntry object
This commit is contained in:
parent
1cc6a733ba
commit
46b7de1130
|
@ -74,7 +74,10 @@ SearchResponse.prototype.send = function (entry, nofiltering) {
|
|||
entry = new SearchEntry({
|
||||
objectName: typeof (save.dn) === 'string' ? parseDN(save.dn) : save.dn,
|
||||
messageId: self.messageId,
|
||||
attributes: Attribute.fromObject(entry.attributes)
|
||||
attributes: Attribute.fromObject(entry.attributes),
|
||||
getAttribute: function(a) {
|
||||
this.attributes.filter(f => f.type === a).map(m -> m.values).pop()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -100,7 +103,8 @@ SearchResponse.prototype.createSearchEntry = function (object) {
|
|||
const entry = new SearchEntry({
|
||||
messageId: this.messageId,
|
||||
objectName: object.objectName || object.dn,
|
||||
attributes: object.attributes ?? []
|
||||
attributes: object.attributes ?? [],
|
||||
getAttribute: object.getAttribute ?? function() { return null }
|
||||
})
|
||||
return entry
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue