diff --git a/src/script/management-sdk.ts b/src/script/management-sdk.ts index 61f1fd0..404d4e9 100644 --- a/src/script/management-sdk.ts +++ b/src/script/management-sdk.ts @@ -72,7 +72,7 @@ class AccountManager { } public isAuthenticated(throwIfUnauthorized?: boolean): Promise { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { var request: superagent.Request = superagent.get(this._serverUrl + urlEncode`/authenticated`); if (this._proxy) (request).proxy(this._proxy); this.attachCredentials(request); @@ -367,7 +367,7 @@ class AccountManager { private packageFileFromPath(filePath: string): Promise { var getPackageFilePromise: Promise; if (fs.lstatSync(filePath).isDirectory()) { - getPackageFilePromise = new Promise((resolve: (file: PackageFile) => void, reject: (reason: Error) => void): void => { + getPackageFilePromise = new Promise((resolve: (file: PackageFile) => void, reject: (reason: Error) => void): void => { var directoryPath: string = filePath; recursiveFs.readdirr(directoryPath, (error?: any, directories?: string[], files?: string[]): void => { @@ -405,9 +405,9 @@ class AccountManager { }); }); } else { - getPackageFilePromise = new Promise((resolve: (file: PackageFile) => void, reject: (reason: Error) => void): void => { - resolve({ isTemporary: false, path: filePath }); - }); + getPackageFilePromise = new Promise((resolve: (file: PackageFile) => void, reject: (reason: Error) => void): void => { + resolve({ isTemporary: false, path: filePath }); + }); } return getPackageFilePromise; } diff --git a/src/test/superagent-mock-config.js b/src/test/superagent-mock-config.js index a68c18e..9a387ea 100644 --- a/src/test/superagent-mock-config.js +++ b/src/test/superagent-mock-config.js @@ -1,55 +1,55 @@ // ./superagent-mock-config.js file module.exports = [ - { - pattern: 'http://localhost/(\\w+)/', + { + pattern: 'http://localhost/(\\w+)/', - /** - * returns the data - * - * @param match array Result of the resolution of the regular expression - * @param params object sent by 'send' function - */ - fixtures: function (match, params) { - return {text: "Error", status: 403, ok: false}; + /** + * returns the data + * + * @param match array Result of the resolution of the regular expression + * @param params object sent by 'send' function + */ + fixtures: function (match, params) { + return { text: "Error", status: 403, ok: false }; - /** - * example: - * request.get('https://error.example/404').end(function(err, res){ - * console.log(err); // 404 - * }) - */ - if (match[1] === '404') { - throw new Error(404); - } + /** + * example: + * request.get('https://error.example/404').end(function(err, res){ + * console.log(err); // 404 + * }) + */ + if (match[1] === '404') { + throw new Error(404); + } - /** - * example: - * request.get('https://error.example/200').end(function(err, res){ - * console.log(res.body); // "Data fixtures" - * }) - */ + /** + * example: + * request.get('https://error.example/200').end(function(err, res){ + * console.log(res.body); // "Data fixtures" + * }) + */ - /** - * example: - * request.get('https://domain.send.example/').send({superhero: "me"}).end(function(err, res){ - * console.log(res.body); // "Data fixtures - superhero:me" - * }) - */ - if(params["superhero"]) { - return 'Data fixtures - superhero:' + params["superhero"]; - } else { - return 'Data fixtures'; - } - }, + /** + * example: + * request.get('https://domain.send.example/').send({superhero: "me"}).end(function(err, res){ + * console.log(res.body); // "Data fixtures - superhero:me" + * }) + */ + if (params["superhero"]) { + return 'Data fixtures - superhero:' + params["superhero"]; + } else { + return 'Data fixtures'; + } + }, - /** - * returns the result of the request - * - * @param match array Result of the resolution of the regular expression - * @param data mixed Data returns by `fixtures` attribute - */ - callback: function (match, data) { - return data; - } - }, -]; \ No newline at end of file + /** + * returns the result of the request + * + * @param match array Result of the resolution of the regular expression + * @param data mixed Data returns by `fixtures` attribute + */ + callback: function (match, data) { + return data; + } + }, +];