fix: use correct return type for async functions

This commit is contained in:
Cori Hudson 2022-09-26 15:19:09 -04:00
parent b67ea684e7
commit beda44ed7b
2 changed files with 4 additions and 4 deletions

View file

@ -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<array>} - results of `func` applied to each item in `arr`
*/
exports.batchMap = async (arr, batchSize, func) => {
const results = [];

View file

@ -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<string>} - 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<object>} - 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>} - array of strings, slugs identifying each resource in the project
*/
const txResources = async function (project) {
const resources = await transifexApi.Resource.filter({