0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Remove switch statement

This commit is contained in:
Trevor Buckner
2023-02-07 10:36:51 -05:00
parent 63346cfd7a
commit 2ac09130a6

View File

@@ -3,13 +3,12 @@ const dedent = require('dedent-tabs').default;
module.exports = {
edge : (side = 'bottom')=>{
let rotation;
switch (side){
case 'bottom': rotation = 0; break;
case 'top' : rotation = 180; break;
case 'left' : rotation = 90; break;
case 'right' : rotation = 270; break;
}
const rotation = {
'bottom' : 0,
'top' : 180,
'left' : 90,
'right' : 270
}[side];
return dedent`
{{imageMaskEdge${_.random(1, 8)},--offset:0cm,--rotation:${rotation};
![](https://i.imgur.com/GZfjDWV.png){height:100%}