0
const directoryToBeZipped = `${LOCAL_FILE_PATH}/${attachment.Key}`;
const zipFilePath = `${LOCAL_FILE_PATH}/${zippedFileKey}`;
zipTime = await streamZipLocalDirectory(directoryToBeZipped, zipFilePath);

and

/**
 *  Compress a local directory with all contents into a local zip file;
 *  @param {string} directoryToBeZipped path of local directory that is to be compressed
 *  @param {string} zippedFilePath path of the resultant zip file
 *  @returns {Promise<number>} total execution time in seconds
 */
export const streamZipLocalDirectory = async (
  directoryToBeZipped,
  zippedFilePath
) => {

I get this error:

error TS7006: Parameter 'directoryToBeZipped' implicitly has an 'any' type.
error TS7006: Parameter 'zippedFilePath' implicitly has an 'any' type.

I understand what this means.

My question is, how is it possible to get this error?

I have this

const zipFilePath = `${A}/${B}`

Why is it not a string? why is it implicitly having an 'any' type?

Phil
  • 157,677
  • 23
  • 242
  • 245
Kid_Learning_C
  • 2,605
  • 4
  • 39
  • 71
  • 3
    The error is about the parameters, not your variables. – DallogFheir Aug 01 '23 at 03:57
  • 1
    Does this answer your question? [Set type for function parameters?](https://stackoverflow.com/questions/8407622/set-type-for-function-parameters), specifically [this answer](https://stackoverflow.com/a/62105704/283366) – Phil Aug 01 '23 at 04:06

0 Answers0