protocols/LDAP.js
function dnToDomain (dn) {
  if (!dn || typeof dn !== 'string') { return null }
  var matches = domainDnRegex.exec(dn)
  if (matches) {
    return matches[1].replace(dnPartRegex, '$1.').toLowerCase()
  } else {
    return null
  }
}
function dnToDomain (dn) {
  if (!dn || typeof dn !== 'string') { return null }
  var matches = domainDnRegex.exec(dn)
  if (matches) {
    return matches[1].replace(dnPartRegex, '$1.').toLowerCase()
  } else {
    return null
  }
}
function dnToDomain ( dn ) { if ( ! dn || typeof dn !== 'string' ) { return null } var matches = domainDnRegex . exec ( dn ) if ( matches ) { return matches [ 1 ] . replace ( dnPartRegex , '$1.' ) . toLowerCase ( ) } else { return null } }
Extracts a lowercased domain from a distinguished name for comparison
purposes.

e.g. "CN=User,OU=MyBusiness,DC=example,DC=com" will return "example.com."
Extracts a lowercased domain from a distinguished name for comparison purposes .