diff --git a/lib/dn.js b/lib/dn.js index c029d95..b4a1106 100644 --- a/lib/dn.js +++ b/lib/dn.js @@ -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, diff --git a/package.json b/package.json index 4c8da7b..57dc93f 100644 --- a/package.json +++ b/package.json @@ -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"