From 732a73c1b1f675f64d4a56ccc0030a7d7b6737ab Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Sun, 21 Jun 2015 14:26:24 -0400 Subject: [PATCH 1/2] callback on check should pass isLocked boolean --- lockfile/lockfile.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lockfile/lockfile.d.ts b/lockfile/lockfile.d.ts index 99dfbe28d..1f3acdebc 100644 --- a/lockfile/lockfile.d.ts +++ b/lockfile/lockfile.d.ts @@ -18,7 +18,7 @@ declare module 'lockfile' { export function unlock(path: string, callback: (err: Error) => void): void; export function unlockSync(path: string):void; - export function check(path: string, opts: Options, callback: (err: Error) => void): void; - export function check(path: string, callback: (err: Error) => void): void; + export function check(path: string, opts: Options, callback: (err: Error, isLocked: boolean) => void): void; + export function check(path: string, callback: (err: Error, isLocked: boolean) => void): void; export function checkSync(path: string, opts: Options): boolean; } From 7ff4d6f0c5d8ebe7546ecaa40de885f1652f4c1d Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Sun, 21 Jun 2015 14:28:30 -0400 Subject: [PATCH 2/2] adds test for check callback --- lockfile/lockfile-tests.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lockfile/lockfile-tests.ts b/lockfile/lockfile-tests.ts index 49aa423d9..9ebb956da 100644 --- a/lockfile/lockfile-tests.ts +++ b/lockfile/lockfile-tests.ts @@ -9,6 +9,9 @@ var path: string; var opts: lockfile.Options; var callback: (err: Error) => { +}; +var callback2: (err: Error, isLocked: boolean) => { + }; opts = { @@ -25,7 +28,7 @@ lockfile.lockSync(path, opts); lockfile.unlock(path, callback);; lockfile.unlockSync(path); -lockfile.check(path, opts, callback); -lockfile.check(path, callback); +lockfile.check(path, opts, callback2); +lockfile.check(path, callback2); bool = lockfile.checkSync(path, opts);