remove unsafe eval

This commit is contained in:
Georges-Antoine Assi
2025-07-17 00:25:14 -04:00
parent b80ef8fb7e
commit f6d188dce7

View File

@@ -58,7 +58,8 @@ export default defineStore("platforms", {
getAspectRatio(platformId: number): number {
const platform = this.allPlatforms.find((p) => p.id === platformId);
return platform && platform.aspect_ratio
? parseFloat(eval(platform.aspect_ratio as string))
? parseInt(platform.aspect_ratio.split("/")[0]) /
parseInt(platform.aspect_ratio.split("/")[1])
: 2 / 3;
},
reset() {