Skip to content

Commit

Permalink
Formatting changes (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
vajahath authored Mar 28, 2024
1 parent 2665f2e commit ecd17b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/utils/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { getErrorMessage } from "./get-error-message";
export function readTypedJsonSync<T>(filePath: string) {
try {
const rawContent = fs.readFileSync(filePath, "utf-8");
const data = JSON.parse(stripJsonComments(rawContent, { trailingCommas: true })) as T;
const data = JSON.parse(
stripJsonComments(rawContent, { trailingCommas: true })
) as T;
return data;
} catch (err) {
throw new Error(
Expand All @@ -18,7 +20,9 @@ export function readTypedJsonSync<T>(filePath: string) {
export async function readTypedJson<T>(filePath: string) {
try {
const rawContent = await fs.readFile(filePath, "utf-8");
const data = JSON.parse(stripJsonComments(rawContent, { trailingCommas: true })) as T;
const data = JSON.parse(
stripJsonComments(rawContent, { trailingCommas: true })
) as T;
return data;
} catch (err) {
throw new Error(
Expand Down

0 comments on commit ecd17b4

Please sign in to comment.