Skip to content

Commit 7058948

Browse files
scottdallamurabryanmacfarlane
authored andcommitted
don't need Q anymore (#99)
* don't need Q anymore * fix comment
1 parent 3bee710 commit 7058948

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

api/GalleryCompatHttpClientBase.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1212

13-
14-
import Q = require('q');
1513
import * as restm from 'typed-rest-client/RestClient';
1614
import * as httpm from 'typed-rest-client/HttpClient';
1715
import vsom = require('./VsoClient');

api/WebApi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export function getPersonalAccessTokenHandler(token) {
6262

6363
// ---------------------------------------------------------------------------
6464
// Factory to return client apis
65-
// When new APIs are added, two methods must be added here to instantiate the
66-
// API and its corresponding Q Promise-wrapped API
65+
// When new APIs are added, a method must be added here to instantiate the API
6766
//----------------------------------------------------------------------------
6867
export class WebApi {
6968

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vso-node-api",
33
"description": "Node client for Visual Studio Online/TFS REST APIs",
4-
"version": "6.2.2-preview",
4+
"version": "6.2.3-preview",
55
"main": "./WebApi.js",
66
"typings": "./WebApi.d.ts",
77
"scripts": {
@@ -21,7 +21,6 @@
2121
],
2222
"license": "MIT",
2323
"dependencies": {
24-
"q": "^1.0.1",
2524
"tunnel": "0.0.4",
2625
"typed-rest-client": "^0.10.0",
2726
"underscore": "^1.8.3"

samples/task.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as Q from 'q';
21
import * as fs from 'fs';
32
import * as path from 'path';
43
import * as stream from 'stream';
@@ -31,11 +30,12 @@ export async function run() {
3130
let taskDefinition = tasks[0];
3231
let file: NodeJS.WritableStream = fs.createWriteStream(sampleFilePath);
3332
let stream = (await vstsTask.getTaskContentZip(taskDefinition.id, `${taskDefinition.version.major}.${taskDefinition.version.minor}.${taskDefinition.version.patch}`)).pipe(file);
34-
let defer = Q.defer();
35-
stream.on('finish', () => {
36-
defer.resolve();
33+
let promise = new Promise((resolve, reject) => {
34+
stream.on('finish', () => {
35+
resolve();
36+
});
3737
});
38-
await defer.promise;
38+
await promise;
3939
console.log(`Downloaded task ${taskDefinition.name}`);
4040
}
4141

0 commit comments

Comments
 (0)