The old Attribute.isAttribute would allow objects lacking the toBer
method to be attached to Change objects. This would result in errors
during serialization.
With the stricter Attribute detection, it's necessary to convert
Attribute-like objects containing type (string) and vals (array)
properties into real Attribute objects. This precise detection is
necessary to avoid falling back to the object-keys-into-attributes
That other logic which will turn a well structured Attribute-like object
such as this:
{ type: 'valid', vals: ['something'] }
... and turn it into something broken like this:
[
{ type: 'type', vals: ['valid'] },
{ type: 'vals', vals: ['something'] }
]
When initializing an Attribute object, the 'vals' option field was being
loosely tested for content presence. By changing this test to a strict
comparison against undefined, Attribute object creation will be more
consistent across input values.
Fixmcavage/node-ldapjs#178