From beda44ed7b9062342286552c27436e0ae9b87bf1 Mon Sep 17 00:00:00 2001 From: Cori Hudson Date: Mon, 26 Sep 2022 15:19:09 -0400 Subject: [PATCH] fix: use correct return type for async functions --- lib/batch.js | 2 +- lib/transifex.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/batch.js b/lib/batch.js index e9f168c5..1ffe1215 100644 --- a/lib/batch.js +++ b/lib/batch.js @@ -3,7 +3,7 @@ * @param {array} arr - array of values * @param {number} batchSize - number of calls to `func` to do at one time * @param {function} func - async function to apply to all items in `arr`. Function should take one argument. - * @return {array} - results of `func` applied to each item in `arr` + * @return {Promise} - results of `func` applied to each item in `arr` */ exports.batchMap = async (arr, batchSize, func) => { const results = []; diff --git a/lib/transifex.js b/lib/transifex.js index ac262dae..2a7f4168 100644 --- a/lib/transifex.js +++ b/lib/transifex.js @@ -29,7 +29,7 @@ try { * @param {string} resourceSlug - resource slug (for example, "blocks") * @param {string} localeCode - language code (for example, "ko") * @param {string} mode - translation status of strings to include - * @returns {string} - id of the created download event + * @returns {Promise} - id of the created download event */ const downloadResource = async function (projectSlug, resourceSlug, localeCode, mode = 'default') { const resource = { @@ -67,7 +67,7 @@ const downloadResource = async function (projectSlug, resourceSlug, localeCode, * @param {string} resource - resource slug (for example, "blocks") * @param {string} locale - language code (for example, "ko") * @param {string} mode - translation status of strings to include - * @returns {object} - JSON object of translated resource strings (or, of the original resourse + * @returns {Promise} - JSON object of translated resource strings (or, of the original resourse * strings, if the local is the source language) */ const txPull = async function (project, resource, locale, mode = 'default') { @@ -87,7 +87,7 @@ const txPull = async function (project, resource, locale, mode = 'default') { /** * Given a project, returns a list of the slugs of all resources in the project * @param {string} project - project slug (for example, "scratch-website") - * @returns {array} - array of strings, slugs identifying each resource in the project + * @returns {Promise} - array of strings, slugs identifying each resource in the project */ const txResources = async function (project) { const resources = await transifexApi.Resource.filter({