Fix slug lookup and add regression test
This commit is contained in:
1 parent
c006971cbe
commit
3e26376584
3 files changed
+37
No files matched your search
@@ -3167,6 +3167,11 @@ export const calculators: CalculatorDef[] = [
|
||||
|
||||
];
|
||||
|
||||
const slugIndex: Map<string, CalculatorDef> = new Map(
|
||||
calculators.map(calc => [calc.slug, calc])
|
||||
);
|
||||
|
||||
|
||||
export function getCalculatorBySlug(slug: string): CalculatorDef | undefined {
|
||||
return slugIndex.get(slug);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user