Skip to content

Commit

Permalink
fix: app tree types
Browse files Browse the repository at this point in the history
  • Loading branch information
seankwarren committed Feb 9, 2024
1 parent 22714d1 commit 513e4da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/js/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { applicationData as APP_DATA } from "./data/application_data";
* @param appName {str}
* @returns {object}
*/
export function getAppData(appName: AllowedApplications): ApplicationData {
if (!(appName in APP_DATA)) {
export function getAppData(appName: AllowedApplications) {
const app_data = APP_DATA as {[key in AllowedApplications]: ApplicationData};
if (!(appName in app_data)) {
throw new Error(`${appName} is not a known application with data.`);
}
return APP_DATA[appName] as ApplicationData;
return app_data[appName];
}

0 comments on commit 513e4da

Please sign in to comment.