I have a forEach that takes in a string and outputs an object. How would I type this appropriately?
descriptionParts.forEach((text: string) => {
let parts = {
text,
isLink: false
}
if (text.match('^#') || text.match('^@')) {
parts = {
text: `<span class=${this.boldClass}>${text}</span>`,
isLink: true
};
}
parsedDescriptionParts.pushObject(parts);
});
Aucun commentaire:
Enregistrer un commentaire