rebase to branch next, fixing issue #434 (can delete attributes)
This commit is contained in:
parent
cf49ee03f8
commit
b66da2c76e
|
@ -82,7 +82,7 @@ Object.defineProperties(Change.prototype, {
|
||||||
val[k].forEach(function (v) {
|
val[k].forEach(function (v) {
|
||||||
_attr.addValue(v.toString());
|
_attr.addValue(v.toString());
|
||||||
});
|
});
|
||||||
} else {
|
} else if (val[k] !== undefined && val[k] !== null) {
|
||||||
_attr.addValue(val[k].toString());
|
_attr.addValue(val[k].toString());
|
||||||
}
|
}
|
||||||
this._modification = _attr;
|
this._modification = _attr;
|
||||||
|
|
|
@ -506,6 +506,22 @@ test('modify change plain object success', function (t) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// https://github.com/ldapjs/node-ldapjs/pull/435
|
||||||
|
test('can delete attributes', function (t) {
|
||||||
|
try {
|
||||||
|
var change = new Change({
|
||||||
|
type: 'Delete',
|
||||||
|
modification: { cn: null }
|
||||||
|
});
|
||||||
|
t.ok(true);
|
||||||
|
t.end();
|
||||||
|
} catch (err) {
|
||||||
|
t.ifError(err);
|
||||||
|
t.end();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
test('modify array success', function (t) {
|
test('modify array success', function (t) {
|
||||||
var changes = [
|
var changes = [
|
||||||
new Change({
|
new Change({
|
||||||
|
|
Loading…
Reference in New Issue