mapcomplete/UI/Base/Img.ts
2021-01-03 00:19:42 +01:00

16 lines
366 B
TypeScript

export default class Img {
public static runningFromConsole = false;
static AsData(source:string){
if(this.runningFromConsole){
return source;
}
return `data:image/svg+xml;base64,${(btoa(source))}`;
}
static AsImageElement(source: string): string{
return `<img src="${Img.AsData(source)}">`;
}
}