Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data.forEach((x) => {
const stateImage = new Alexa.ImageHelper().withDescription(`${x.StateName} state flag`);
for (let y = 0; y < imgHeight.length; y += 1) {
stateImage.addImageInstance(getImageUrl(imgHeight[y], imgWidth[y], x.Abbreviation));
}
statesList.push({
token: x.Abbreviation,
textContent: new Alexa.PlainTextContentHelper()
.withPrimaryText(x.StateName)
.withSecondaryText(`Abbreviation: ${x.Abbreviation}`)
.withTertiaryText(`Capital: ${x.Capital}`)
.getTextContent(),
image: stateImage.getImage(),
});
});
responseBuilder.addRenderTemplateDirective({