File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,10 @@ export function useMatchesData(
45
45
const paths = Array . isArray ( id ) ? id : [ id ] ;
46
46
47
47
// Get the first matching route
48
- const route = paths . reduce (
49
- ( acc , path ) => {
50
- if ( acc ) return acc ;
51
- return matchingRoutes . find ( ( route ) => route . id === path ) ;
52
- } ,
53
- undefined as RouteMatch | undefined
54
- ) ;
48
+ const route = paths . reduce ( ( acc , path ) => {
49
+ if ( acc ) return acc ;
50
+ return matchingRoutes . find ( ( route ) => route . id === path ) ;
51
+ } , undefined as RouteMatch | undefined ) ;
55
52
56
53
return route ;
57
54
}
@@ -76,7 +73,7 @@ export function hydrateDates(object: any): any {
76
73
if (
77
74
typeof object === "string" &&
78
75
object . match ( / \d { 4 } - \d { 2 } - \d { 2 } / ) &&
79
- ! isNaN ( Date . parse ( object ) )
76
+ ! Number . isNaN ( Date . parse ( object ) )
80
77
) {
81
78
return new Date ( object ) ;
82
79
}
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ export async function removeFile(path: string) {
25
25
}
26
26
27
27
export async function readFile ( path : string ) {
28
- return await fsModule . readFile ( path , "utf-8 " ) ;
28
+ return await fsModule . readFile ( path , "utf8 " ) ;
29
29
}
30
30
31
31
export async function readJSONFile ( path : string ) {
32
- const fileContents = await fsModule . readFile ( path , "utf-8 " ) ;
32
+ const fileContents = await fsModule . readFile ( path , "utf8 " ) ;
33
33
34
34
return JSON . parse ( fileContents ) ;
35
35
}
@@ -39,7 +39,7 @@ export async function writeJSONFile(path: string, json: any) {
39
39
}
40
40
41
41
export function readJSONFileSync ( path : string ) {
42
- const fileContents = fsSync . readFileSync ( path , "utf-8 " ) ;
42
+ const fileContents = fsSync . readFileSync ( path , "utf8 " ) ;
43
43
44
44
return JSON . parse ( fileContents ) ;
45
45
}
You can’t perform that action at this time.
0 commit comments