From 1503788c8ddc432759793d7a765ca8a59471ed6d Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Thu, 27 Mar 2014 13:09:09 +0200 Subject: [PATCH 1/2] Update Q.d.ts Add nfapply defintion. See API reference here: https://github.com/kriskowal/q/wiki/API-Reference --- q/Q.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/q/Q.d.ts b/q/Q.d.ts index 85462503a..65b2b8223 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -209,6 +209,7 @@ declare module Q { export function nfbind(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; export function nfcall(nodeFunction: Function, ...args: any[]): Promise; + export function nfapply(nodeFunction: Function, args: any[]): Promise; export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; From da3fcf9a8501354f5564c0965e18a06b75521674 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Sat, 29 Mar 2014 12:45:09 +0200 Subject: [PATCH 2/2] Update Q-tests.ts Add tests for Q.nfapply and Q.nfcall. --- q/Q-tests.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 22f33506e..6b69fb228 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -109,3 +109,9 @@ Q.allSettled([saveToDisk(), saveToCloud()]).spread(function (disk, cloud) { } }).done(); +var nodeStyle = (input: string, cb: Function) => { + cb(null, input); +}; + +Q.nfapply(nodeStyle, ["foo"]).done((result: string) => {}); +Q.nfcall(nodeStyle, "foo").done((result: string) => {});