Skip to content

Commit 44af157

Browse files
committed
Fix formatting
1 parent ac187b2 commit 44af157

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

src/modules/emblem/generator.ts

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { P, rw } from "../../utils";
2-
import { charges, divisions, lines, ordinaries, positions, shields, tinctures } from "armoria";
2+
import {
3+
charges,
4+
divisions,
5+
lines,
6+
ordinaries,
7+
positions,
8+
shields,
9+
tinctures,
10+
} from "armoria";
311
import { typeMapping } from "./typeMapping";
412

513
declare global {
@@ -171,13 +179,9 @@ class EmblemGeneratorModule {
171179
!usedPattern && P(0.3)
172180
? tOrdinary!
173181
: this.getTincture("charge", usedTinctures, coa.t1);
174-
} else if (
175-
divisions.data[division]?.positions
176-
) {
182+
} else if (divisions.data[division]?.positions) {
177183
// place charge in fields made by division
178-
p = rw(
179-
divisions.data[division].positions,
180-
);
184+
p = rw(divisions.data[division].positions);
181185
t = this.getTincture(
182186
"charge",
183187
tOrdinary ? usedTinctures.concat(tOrdinary) : usedTinctures,
@@ -247,11 +251,7 @@ class EmblemGeneratorModule {
247251
const p2 =
248252
p === "e" || P(0.5)
249253
? "e"
250-
: rw(
251-
divisions.data[
252-
division
253-
].positions,
254-
);
254+
: rw(divisions.data[division].positions);
255255
const chargeNew = this.selectCharge(charges.single);
256256
const tNew = this.getTincture(
257257
"charge",
@@ -444,7 +444,7 @@ class EmblemGeneratorModule {
444444

445445
// Size selection - must use sequential P() calls to match original behavior
446446
if (P(0.1)) size = "-small";
447-
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
447+
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
448448
else if (P(0.1)) size = "-smaller";
449449
else if (P(0.01)) size = "-big";
450450
else if (P(0.005)) size = "-smallest";
@@ -460,11 +460,11 @@ class EmblemGeneratorModule {
460460
if (P(0.2)) {
461461
t1 = "gules";
462462
t2 = "or";
463-
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
463+
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
464464
} else if (P(0.2)) {
465465
t1 = "argent";
466466
t2 = "sable";
467-
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
467+
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
468468
} else if (P(0.2)) {
469469
t1 = "azure";
470470
t2 = "argent";
@@ -473,7 +473,7 @@ class EmblemGeneratorModule {
473473
if (P(0.3)) {
474474
t1 = "gules";
475475
t2 = "argent";
476-
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
476+
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
477477
} else if (P(0.3)) {
478478
t1 = "argent";
479479
t2 = "sable";
@@ -515,9 +515,7 @@ class EmblemGeneratorModule {
515515
const type = this.getType(t);
516516
let n: string | null = null;
517517
while (!n || n === t) {
518-
n = rw(
519-
tinctures[type] as Record<string, number>,
520-
);
518+
n = rw(tinctures[type] as Record<string, number>);
521519
}
522520
return n;
523521
}

src/modules/emblem/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface Emblem {
4242
class EmblemRenderModule {
4343
private async draw(id: string, coa: Emblem) {
4444
// insert coa svg to defs
45-
const svg = await renderCOA({...coa, seed: id}, 200);
45+
const svg = await renderCOA({ ...coa, seed: id }, 200);
4646
document.getElementById("coas")!.insertAdjacentHTML("beforeend", svg);
4747
return true;
4848
}

0 commit comments

Comments
 (0)