ldap-filters
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -30,2 +30,11 @@ var soundex = require('soundex'); | ||
}, | ||
simplify: function(){ | ||
if (this.filters) { | ||
if (this.filters.length == 1) return this.filters[0].simplify(); | ||
else this.filters = this.filters.map(function(filter){ | ||
return filter.simplify(); | ||
}); | ||
} | ||
return this; | ||
}, | ||
_indent: function(indent,level,id_char){ | ||
@@ -209,2 +218,5 @@ var _i = parseInt(indent); | ||
GroupNot.prototype = Object.create(Group.prototype); | ||
GroupNot.prototype.simplify = function(){ | ||
return this; | ||
}; | ||
GroupNot.prototype._match = function(data){ | ||
@@ -211,0 +223,0 @@ return this.filters.every(function(cv,idx,all){ |
{ | ||
"name": "ldap-filters", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Library for generating, parsing, and evaluating LDAP filters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -63,3 +63,3 @@ node-ldap-filters | ||
#### Aggregate methods | ||
#### Logical/Aggregate methods | ||
@@ -85,2 +85,13 @@ Simple filters can be aggregated with AND, OR, and NOT: | ||
### Simplify a filter | ||
The `.simplify()` method will reduce any AND or OR filters that have only | ||
one child/condition and replace them with that filter. NOT filters, and | ||
any other filters will remain intact. | ||
```javascript | ||
var input = '(&(uid=jenny))'; | ||
Filter.parse(input).simplify().toString() // => '(uid=jenny)' | ||
``` | ||
### Output/print | ||
@@ -87,0 +98,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
72736
20
1986
188
0