Fix incorrect JSDoc async return annotations

The return type of an async function should be documented as a Promise
of what the function returns as this is what JSDoc expects.
This commit is contained in:
Hornwitser committed 2023-02-15 20:31:02 +01:00
1 parent a7dedcd3b7
commit 2d8b35291d
12 files changed
+33 -33

No files matched your search

+4 -4
View File
@@ -193,7 +193,7 @@ class Instance extends libLink.Link {
/**
* Mod pack currently running on this instance
* @type {module:lib/data.ModPack>}
* @type {module:lib/data.ModPack}
*/
this.activeModPack = undefined;
@@ -538,7 +538,7 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " ");
* entries from the given settings object.
*
* @param {Object} overrides - Server settings to override.
* @returns {Object}
* @returns {Promise<Object>}
* server example settings with the given settings applied over it.
*/
async resolveServerSettings(overrides) {
@@ -699,10 +699,10 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " ");
*
* Creates a new save if no save is passed and patches it with modules.
*
* @param {String|null} saveName -
* @param {string|null} saveName -
* Save to prepare from the instance saves directory. Creates a new
* save if null.
* @returns {String} Name of the save prepared.
* @returns {Promise<string>} Name of the save prepared.
*/
async prepareSave(saveName) {
// Use latest save if no save was specified
+2 -2
View File
@@ -41,7 +41,7 @@ function checkRequestSaveName(name) {
* instanceInfo objects.
*
* @param {string} instancesDir - Directory containing instances
* @returns {Map<integer, Object>}
* @returns {Promise<Map<integer, Object>>}
* mapping between instance id and information about this instance.
* @private
*/
@@ -379,7 +379,7 @@ class Slave extends libLink.Link {
* Initialize and connect an unloaded instance
*
* @param {number} instanceId - ID of instance to initialize.
* @returns {module:slave/slave~InstanceConnection} connection to instance.
* @returns {Promise<module:slave/slave~InstanceConnection>} connection to instance.
*/
async _connectInstance(instanceId) {
let instanceInfo = this.getRequestInstanceInfo(instanceId);