0
const isLicensesValid = async (
  licenseList: Promise<string>[]
): Promise<string> => {
  let errorText = "";
  await licenseList.forEach(async (licenseFile) => {
    await licenseFile.then(async (licenseData: string) => {
      const licenseType = await Object.keys(
        JSON.parse(licenseData).Features
      )[0];
      if (!isLicenseValid(licenseData, licenseType.toLowerCase())) {
        errorText = "One or more invalid license file in zip";
      }
    });
  });
  return errorText;
};

not sure why errorText always returns empty. Await is not working in then function. Can someone please suggest what is the problem here

Konrad
  • 21,590
  • 4
  • 28
  • 64
raj m
  • 1,863
  • 6
  • 21
  • 37

0 Answers0