Skip to content

Commit

Permalink
Adjust based on linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyfagan committed Dec 13, 2024
1 parent 933d517 commit 19f723e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import express, { Request, Response } from "express";
import { AuthorizationToken, BlueButton } from "cms-bluebutton-sdk";
import express, {Request, Response} from "express";
import {AuthorizationToken, BlueButton} from "cms-bluebutton-sdk";
import * as fs from "fs";

interface User {
Expand Down Expand Up @@ -106,8 +106,16 @@ app.get("/api/bluebutton/loadDefaults", (req: Request, res: Response) => {
});

// helper to load json data from file
function loadDataFile(dataset_name: string, resource_file_name: string) {
return JSON.parse(fs.readFileSync(`./default_datasets/${dataset_name}/${resource_file_name}.json`, 'utf-8'))
function loadDataFile(dataset_name: string, resource_file_name: string): any {
const filename = `./default_datasets/${dataset_name}/${resource_file_name}.json`
const resource = fs.readFileSync(filename, 'utf-8')

try {
return JSON.parse(resource);
} catch (error) {
console.error("Error parsing JSON:", error);

Check warning on line 116 in server/index.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
return null
}
}

// data flow: front end fetch eob
Expand Down

0 comments on commit 19f723e

Please sign in to comment.