From 2422f4a95c44126a5eae05635436d636de000d7e Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 12 Oct 2022 14:52:59 +0700 Subject: [PATCH] Fixed minor jsdoc typing issue regarding arrays - `[string]` indicates an array with exactly one item but we actually want the type to be `string[]` to indicate an array of strings --- ghost/core/core/server/data/schema/commands.js | 6 +++--- .../core/server/services/bulk-email/bulk-email-processor.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ghost/core/core/server/data/schema/commands.js b/ghost/core/core/server/data/schema/commands.js index ac82c7b6bf..04dc071cb9 100644 --- a/ghost/core/core/server/data/schema/commands.js +++ b/ghost/core/core/server/data/schema/commands.js @@ -126,7 +126,7 @@ async function dropColumn(tableName, column, transaction = db.knex, columnSpec = * Adds an unique index to a table over the given columns. * * @param {string} tableName - name of the table to add unique constraint to - * @param {string|[string]} columns - column(s) to form unique constraint with + * @param {string|string[]} columns - column(s) to form unique constraint with * @param {import('knex')} transaction - connection object containing knex reference */ async function addUnique(tableName, columns, transaction = db.knex) { @@ -153,7 +153,7 @@ async function addUnique(tableName, columns, transaction = db.knex) { * Drops a unique key constraint from a table. * * @param {string} tableName - name of the table to drop unique constraint from - * @param {string|[string]} columns - column(s) unique constraint was formed + * @param {string|string[]} columns - column(s) unique constraint was formed * @param {import('knex')} transaction - connection object containing knex reference */ async function dropUnique(tableName, columns, transaction = db.knex) { @@ -327,7 +327,7 @@ async function hasPrimaryKeySQLite(tableName, transaction = db.knex) { * Adds an primary key index to a table over the given columns. * * @param {string} tableName - name of the table to add primaykey constraint to - * @param {string|[string]} columns - column(s) to form primary key constraint with + * @param {string|string[]} columns - column(s) to form primary key constraint with * @param {import('knex')} transaction - connection object containing knex reference */ async function addPrimaryKey(tableName, columns, transaction = db.knex) { diff --git a/ghost/core/core/server/services/bulk-email/bulk-email-processor.js b/ghost/core/core/server/services/bulk-email/bulk-email-processor.js index 7d5bd4888d..88514e5a71 100644 --- a/ghost/core/core/server/services/bulk-email/bulk-email-processor.js +++ b/ghost/core/core/server/services/bulk-email/bulk-email-processor.js @@ -208,7 +208,7 @@ module.exports = { /** * @param {Email-like} emailData - The email to send, must be a POJO so emailModel.toJSON() before calling if needed - * @param {[EmailRecipient]} recipients - The recipients to send the email to with their associated data + * @param {EmailRecipient[]} recipients - The recipients to send the email to with their associated data * @param {string?} memberSegment - The member segment of the recipients * @returns {Promise} - {providerId: 'xxx'} */