File tree 4 files changed +6
-13
lines changed
4 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -266,11 +266,7 @@ export class CurrentRun {
266
266
} else {
267
267
let localPath = this . #realmPaths. local ( url ) ;
268
268
269
- let fileRef = await this . #reader. readFileAsText (
270
- localPath ,
271
- { } ,
272
- this . loader ,
273
- ) ;
269
+ let fileRef = await this . #reader. readFileAsText ( localPath , { } ) ;
274
270
if ( ! fileRef ) {
275
271
let error = new CardError ( `missing file ${ url . href } ` , { status : 404 } ) ;
276
272
error . deps = [ url . href ] ;
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export interface RealmAdapter {
117
117
} ,
118
118
) : AsyncGenerator < { name : string ; path : LocalPath ; kind : Kind } , void > ;
119
119
120
- openFile ( path : LocalPath , loader ?: Loader ) : Promise < FileRef | undefined > ;
120
+ openFile ( path : LocalPath ) : Promise < FileRef | undefined > ;
121
121
122
122
exists ( path : LocalPath ) : Promise < boolean > ;
123
123
@@ -1211,7 +1211,6 @@ export class Realm {
1211
1211
path ,
1212
1212
this . #adapter. openFile . bind ( this . #adapter) ,
1213
1213
fallbackExtensions ,
1214
- this . loader ,
1215
1214
) ;
1216
1215
}
1217
1216
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ export interface Reader {
36
36
readFileAsText : (
37
37
path : LocalPath ,
38
38
opts ?: { withFallbacks ?: true } ,
39
- loader ?: Loader ,
40
39
) => Promise < { content : string ; lastModified : number } | undefined > ;
41
40
readdir : (
42
41
path : string ,
Original file line number Diff line number Diff line change 1
- import { isNode , executableExtensions , Loader } from './index' ;
1
+ import { isNode , executableExtensions } from './index' ;
2
2
import type { FileRef } from './realm' ;
3
3
import type { LocalPath } from './paths' ;
4
4
@@ -74,17 +74,16 @@ export async function readFileAsText(
74
74
// explicit file extensions in your source code
75
75
export async function getFileWithFallbacks (
76
76
path : LocalPath ,
77
- openFile : ( path : string , loader ?: Loader ) => Promise < FileRef | undefined > ,
77
+ openFile : ( path : string ) => Promise < FileRef | undefined > ,
78
78
fallbackExtensions : string [ ] ,
79
- loader ?: Loader ,
80
79
) : Promise < FileRef | undefined > {
81
- let result = await openFile ( path , loader ) ;
80
+ let result = await openFile ( path ) ;
82
81
if ( result ) {
83
82
return result ;
84
83
}
85
84
86
85
for ( let extension of fallbackExtensions ) {
87
- result = await openFile ( path + extension , loader ) ;
86
+ result = await openFile ( path + extension ) ;
88
87
if ( result ) {
89
88
return result ;
90
89
}
You can’t perform that action at this time.
0 commit comments