diff --git a/types/ldapjs/index.d.ts b/types/ldapjs/index.d.ts index 60d2edf44e..5d0298c73b 100644 --- a/types/ldapjs/index.d.ts +++ b/types/ldapjs/index.d.ts @@ -366,7 +366,7 @@ declare class Filter { export function parseFilter(filterString: string): Filter; export class EqualityFilter extends Filter { - constructor(options: { attribute: string, value: string }) + constructor(options: { attribute: string, value: string | Buffer }) } export class PresenceFilter extends Filter { diff --git a/types/ldapjs/ldapjs-tests.ts b/types/ldapjs/ldapjs-tests.ts index 8e38f395ed..cd16328d0b 100644 --- a/types/ldapjs/ldapjs-tests.ts +++ b/types/ldapjs/ldapjs-tests.ts @@ -72,6 +72,19 @@ let equalityFilter = new ldap.EqualityFilter({ }); equalityFilter.matches({ cn: 'foo' }); +let objectGUID = Buffer.from([ + 0x02, 0xa9, 0xe3, 0x6f, + 0x58, 0x11, + 0x18, 0x49, + 0xb5, 0x60, + 0x60, 0xad, 0x50, 0x86, 0x18, 0xc9 +]); +let equalityFilterBuffer = new ldap.EqualityFilter({ + attribute: 'objectGUID', + value: objectGUID +}); +equalityFilterBuffer.matches({ objectGUID }); + let presenceFilter = new ldap.PresenceFilter({ attribute: 'cn' });