Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promisifyMethod return object instead of array to allow for destructuring #1186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Readme.md
Expand Up @@ -160,8 +160,8 @@ Construct a `Promise<Client>` with the given WSDL file.

// async/await
var client = await soap.createClientAsync(url);
var result = await client.MyFunctionAsync(args);
console.log(await result);
var { result } = await client.MyFunctionAsync(args);
console.log(result);
```

Note: for versions of node >0.10.X, you may need to specify `{connection: 'keep-alive'}` in SOAP headers to avoid truncation of longer chunked responses.
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Expand Up @@ -236,7 +236,7 @@ export class Client extends EventEmitter {
if (err) {
reject(err);
} else {
resolve([result, rawResponse, soapHeader, rawRequest, mtomAttachments]);
resolve({result, rawResponse, soapHeader, rawRequest, mtomAttachments});
}
};
method(
Expand Down