filter documentation updated

This commit is contained in:
devbysn 2023-06-28 10:47:23 +05:30
parent f2890088e4
commit 71336fca3d
1 changed files with 18 additions and 18 deletions

View File

@ -35,15 +35,15 @@ ldapjs object(s). If the filter is "complex", it will be a "tree" of objects.
For example: For example:
```js ```js
const parseFilter = require('ldapjs').parseFilter; const parseFilter = require("ldapjs").parseFilter;
const f = parseFilter('(objectclass=*)'); const f = parseFilter("(objectclass=*)");
``` ```
Is a "simple" filter, and would just return a `PresenceFilter` object. However, Is a "simple" filter, and would just return a `PresenceFilter` object. However,
```js ```js
const f = parseFilter('(&(employeeType=manager)(l=Seattle))'); const f = parseFilter("(&(employeeType=manager)(l=Seattle))");
``` ```
Would return an `AndFilter`, which would have a `filters` array of two Would return an `AndFilter`, which would have a `filters` array of two
@ -112,9 +112,9 @@ map to:
```js ```js
{ {
initial: 'foo', subInitial: 'foo',
any: ['bar', 'cat'], subAny: ['bar', 'cat'],
final: 'dog' subFinal: 'dog'
} }
``` ```
@ -124,9 +124,9 @@ key matching `attribute` and the "regex" matches the value
```js ```js
const f = new SubstringFilter({ const f = new SubstringFilter({
attribute: 'cn', attribute: 'cn',
initial: 'foo', subInitial: 'foo',
any: ['bar'], subAny: ['bar'],
final: 'baz' subFinal: 'baz'
}); });
f.matches({cn: 'foobigbardogbaz'}); => true f.matches({cn: 'foobigbardogbaz'}); => true
@ -242,7 +242,7 @@ equality filters):
(|(cn=foo)(sn=bar)) (|(cn=foo)(sn=bar))
``` ```
The `matches()` method will return true IFF the passed in object matches *any* The `matches()` method will return true IFF the passed in object matches _any_
of the filters in the `filters` array. of the filters in the `filters` array.
```js ```js