new DN methods

This commit is contained in:
Mark Cavage 2011-10-18 08:50:44 -07:00
parent ccff51804a
commit e0007f6f6a
2 changed files with 41 additions and 1 deletions

View File

@ -300,6 +300,46 @@ DN.prototype.parent = function() {
};
DN.prototype.clone = function() {
return new DN(this.rdns);
};
DN.prototype.reverse = function() {
this.rdns.reverse();
return this;
};
DN.prototype.pop = function() {
return this.rdns.pop();
};
DN.prototype.push = function(rdn) {
if (typeof(rdn) !== 'object')
throw new TypeError('rdn (RDN) required');
return this.rdns.push(rdn);
};
DN.prototype.shift = function() {
return this.rdns.shift();
};
DN.prototype.unshift = function(rdn) {
if (typeof(rdn) !== 'object')
throw new TypeError('rdn (RDN) required');
return this.rdns.unshift(rdn);
};
///--- Exports
module.exports = {
parse: parse,

View File

@ -3,7 +3,7 @@
"name": "ldapjs",
"homepage": "http://ldapjs.org",
"description": "LDAP client and server APIs",
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "git://github.com/mcavage/node-ldapjs.git"