From 18c2cdb543cd978058627e12f90a54c31125830e Mon Sep 17 00:00:00 2001 From: Cameron Crothers Date: Mon, 30 Oct 2017 14:50:37 +1100 Subject: [PATCH 1/2] Support ldapjs change as per docs --- types/ldapjs/index.d.ts | 4 ++++ types/ldapjs/ldapjs-tests.ts | 11 +++++++++++ types/ldapjs/tsconfig.json | 3 +-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/types/ldapjs/index.d.ts b/types/ldapjs/index.d.ts index 0afbf16046..8034add042 100644 --- a/types/ldapjs/index.d.ts +++ b/types/ldapjs/index.d.ts @@ -71,6 +71,10 @@ export interface Change { }; } +export var Change: { + new(change: Change): Change; +} + export interface SearchCallBack { (error: Error, result: EventEmitter): void; } diff --git a/types/ldapjs/ldapjs-tests.ts b/types/ldapjs/ldapjs-tests.ts index 6b2d879142..ec106fd29a 100644 --- a/types/ldapjs/ldapjs-tests.ts +++ b/types/ldapjs/ldapjs-tests.ts @@ -18,3 +18,14 @@ let opts: ldap.SearchOptions = { client.search('o=example', opts, (err: Error, res: NodeJS.EventEmitter): void => { // nothing }); + +let change = new ldap.Change({ + operation: 'add', + modification: { + pets: ['cat', 'dog'] + } +}); + +client.modify('cn=foo, o=example', change, function(err) { + // nothing +}); diff --git a/types/ldapjs/tsconfig.json b/types/ldapjs/tsconfig.json index 1f1d5bafc9..1f4da0daf0 100644 --- a/types/ldapjs/tsconfig.json +++ b/types/ldapjs/tsconfig.json @@ -7,7 +7,6 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, - "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +19,4 @@ "index.d.ts", "ldapjs-tests.ts" ] -} \ No newline at end of file +} From 87400f8dce2f15283d6c7d344569012369a5cb33 Mon Sep 17 00:00:00 2001 From: Cameron Crothers Date: Mon, 30 Oct 2017 15:30:07 +1100 Subject: [PATCH 2/2] Put strictFunctionTypes back --- types/ldapjs/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ldapjs/tsconfig.json b/types/ldapjs/tsconfig.json index 1f4da0daf0..a0df7615fd 100644 --- a/types/ldapjs/tsconfig.json +++ b/types/ldapjs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../"