Skip to content

Commit 5726051

Browse files
committed
Fix return types in utils.js
1 parent 748cb14 commit 5726051

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/util.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ async function withAutomaticRetries(request, options = {}) {
247247
* @param {Replicate} client - The client used to upload the file
248248
* @param {object} inputs - The inputs to transform
249249
* @param {"default" | "upload" | "data-uri"} strategy - Whether to upload files to Replicate, encode as dataURIs or try both.
250-
* @returns {object} - The transformed inputs
250+
* @returns {Promise<object>} - The transformed inputs
251251
* @throws {ApiError} If the request to upload the file fails
252252
*/
253253
async function transformFileInputs(client, inputs, strategy) {
@@ -280,7 +280,7 @@ async function transformFileInputs(client, inputs, strategy) {
280280
*
281281
* @param {Replicate} client - The client used to upload the file
282282
* @param {object} inputs - The inputs to transform
283-
* @returns {object} - The transformed inputs
283+
* @returns {Promise<object>} - The transformed inputs
284284
* @throws {ApiError} If the request to upload the file fails
285285
*/
286286
async function transformFileInputsToReplicateFileURLs(client, inputs) {
@@ -301,8 +301,8 @@ const MAX_DATA_URI_SIZE = 10_000_000;
301301
* base64-encoded data URI.
302302
*
303303
* @param {object} inputs - The inputs to transform
304-
* @returns {object} - The transformed inputs
305-
* @throws {Error} If the size of inputs exceeds a given threshould set by MAX_DATA_URI_SIZE
304+
* @returns {Promise<object>} - The transformed inputs
305+
* @throws {Error} If the size of inputs exceeds a given threshold set by MAX_DATA_URI_SIZE
306306
*/
307307
async function transformFileInputsToBase64EncodedDataURIs(inputs) {
308308
let totalBytes = 0;
@@ -311,10 +311,10 @@ async function transformFileInputsToBase64EncodedDataURIs(inputs) {
311311
let mime;
312312

313313
if (value instanceof Blob) {
314-
// Currently we use a NodeJS only API for base64 encoding, as
314+
// Currently, we use a NodeJS only API for base64 encoding, as
315315
// we move to support the browser we could support either using
316316
// btoa (which does string encoding), the FileReader API or
317-
// a JavaScript implenentation like base64-js.
317+
// a JavaScript implementation like base64-js.
318318
// See: https://developer.mozilla.org/en-US/docs/Glossary/Base64
319319
// See: https://github.com/beatgammit/base64-js
320320
buffer = await value.arrayBuffer();

0 commit comments

Comments
 (0)