File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import { getErrorMessage } from "./get-error-message";
6
6
export function readTypedJsonSync < T > ( filePath : string ) {
7
7
try {
8
8
const rawContent = fs . readFileSync ( filePath , "utf-8" ) ;
9
- const data = JSON . parse ( stripJsonComments ( rawContent , { trailingCommas : true } ) ) as T ;
9
+ const data = JSON . parse (
10
+ stripJsonComments ( rawContent , { trailingCommas : true } )
11
+ ) as T ;
10
12
return data ;
11
13
} catch ( err ) {
12
14
throw new Error (
@@ -18,7 +20,9 @@ export function readTypedJsonSync<T>(filePath: string) {
18
20
export async function readTypedJson < T > ( filePath : string ) {
19
21
try {
20
22
const rawContent = await fs . readFile ( filePath , "utf-8" ) ;
21
- const data = JSON . parse ( stripJsonComments ( rawContent , { trailingCommas : true } ) ) as T ;
23
+ const data = JSON . parse (
24
+ stripJsonComments ( rawContent , { trailingCommas : true } )
25
+ ) as T ;
22
26
return data ;
23
27
} catch ( err ) {
24
28
throw new Error (
You can’t perform that action at this time.
0 commit comments