This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const downloadBase64ImageAsPng = async (base64Image: string) => { | |
// Remover encabezado | |
base64Image = base64Image.split(';base64,').pop(); | |
const imageBuffer = Buffer.from(base64Image, 'base64'); | |
const folderPath = path.resolve('./', './generated/images/'); | |
fs.mkdirSync(folderPath, { recursive: true }); | |
const imageNamePng = `${ new Date().getTime() }-64.png`; |
En la definición del método, se puede marcar como obsoleto (deprecated) con la justificación. Esto ayudará a que otros developers sepán que deben de utilizar ya la alternativa.
@Deprecated('Most use speak2 method instead')
speak() {
console.log(`${ this.name }, ${ this.name }!`)
}