Merge pull request #9 from MillenniumEarl/deepsource-transform-5bd5050a

Format code with prettier
pull/10/head
Millennium Earl 2020-10-08 23:57:43 +02:00 committed by GitHub
commit 0014627d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 210 additions and 219 deletions

View File

@ -308,8 +308,7 @@ module.exports.logout = function () {
// Gracefully close shared browser // Gracefully close shared browser
if (!shared.isolation && _browser !== null) { if (!shared.isolation && _browser !== null) {
_browser.close() _browser.close().then(() => (_browser = null));
.then(() => _browser = null);
} }
}; };
//#endregion //#endregion

View File

@ -1,4 +1,4 @@
'use strict'; "use strict";
class GameDownload { class GameDownload {
constructor() { constructor() {
@ -28,16 +28,10 @@ class GameDownload {
* Download the game data in the indicated path * Download the game data in the indicated path
* @param {string} path Save path * @param {string} path Save path
*/ */
download(path){ download(path) {}
}
} }
module.exports = GameDownload; module.exports = GameDownload;
function downloadMEGA(url){ function downloadMEGA(url) {}
} function downloadNOPY(url) {}
function downloadNOPY(url){
}

View File

@ -1,6 +1,6 @@
'use strict'; "use strict";
const UNKNOWN = 'Unknown'; const UNKNOWN = "Unknown";
class GameInfo { class GameInfo {
constructor() { constructor() {
@ -97,8 +97,8 @@ class GameInfo {
lastPlayed: this.lastPlayed, lastPlayed: this.lastPlayed,
isMod: this.isMod, isMod: this.isMod,
gameDir: this.gameDir, gameDir: this.gameDir,
downloadInfo: this.downloadInfo downloadInfo: this.downloadInfo,
} };
} }
/** /**

View File

@ -1,4 +1,4 @@
'use strict'; "use strict";
/** /**
* Class containing the data of the user currently connected to the F95Zone platform. * Class containing the data of the user currently connected to the F95Zone platform.

View File

@ -1,7 +1,7 @@
'use strict'; "use strict";
// Core modules // Core modules
const { join } = require('path'); const { join } = require("path");
/** /**
* Class containing variables shared between modules. * Class containing variables shared between modules.
@ -37,12 +37,12 @@ class Shared {
* Wait instruction for the browser created by puppeteer. * Wait instruction for the browser created by puppeteer.
* @type String * @type String
*/ */
static WAIT_STATEMENT = 'domcontentloaded'; static WAIT_STATEMENT = "domcontentloaded";
/** /**
* Path to the directory to save the cache generated by the API. * Path to the directory to save the cache generated by the API.
* @type String * @type String
*/ */
static _cacheDir = './f95cache'; static _cacheDir = "./f95cache";
/** /**
* If true, it opens a new browser for each request to * If true, it opens a new browser for each request to
* the F95Zone platform, otherwise it reuses the same. * the F95Zone platform, otherwise it reuses the same.
@ -99,21 +99,21 @@ class Shared {
* @returns {String} * @returns {String}
*/ */
static get cookiesCachePath() { static get cookiesCachePath() {
return join(this._cacheDir, 'cookies.json'); return join(this._cacheDir, "cookies.json");
} }
/** /**
* Path to the game engine cache. * Path to the game engine cache.
* @returns {String} * @returns {String}
*/ */
static get enginesCachePath() { static get enginesCachePath() {
return join(this._cacheDir, 'engines.json'); return join(this._cacheDir, "engines.json");
} }
/** /**
* Path to the cache of possible game states. * Path to the cache of possible game states.
* @returns {String} * @returns {String}
*/ */
static get statusesCachePath() { static get statusesCachePath() {
return join(this._cacheDir, 'statuses.json'); return join(this._cacheDir, "statuses.json");
} }
/** /**
* If true, it opens a new browser for each request * If true, it opens a new browser for each request

View File

@ -1,9 +1,7 @@
'use strict'; "use strict";
// Modules from file // Modules from file
const { const { F95_BASE_URL } = require("./constants/urls.js");
F95_BASE_URL
} = require('./constants/urls.js');
/** /**
* @protected * @protected
@ -11,10 +9,10 @@ const {
* @param {String} url URL to check * @param {String} url URL to check
* @returns {Boolean} true if the url belongs to the domain, false otherwise * @returns {Boolean} true if the url belongs to the domain, false otherwise
*/ */
module.exports.isF95URL = function(url) { module.exports.isF95URL = function (url) {
if (url.toString().startsWith(F95_BASE_URL)) return true; if (url.toString().startsWith(F95_BASE_URL)) return true;
else return false; else return false;
} };
/** /**
* @protected * @protected
@ -22,11 +20,11 @@ module.exports.isF95URL = function(url) {
* @param {String} url String to check for correctness * @param {String} url String to check for correctness
* @returns {Boolean} true if the string is a valid URL, false otherwise * @returns {Boolean} true if the string is a valid URL, false otherwise
*/ */
module.exports.isStringAValidURL = function(url) { module.exports.isStringAValidURL = function (url) {
try { try {
new URL(url); new URL(url);
return true; return true;
} catch (err) { } catch (err) {
return false; return false;
} }
} };