File tree Expand file tree Collapse file tree 1 file changed +6
-33
lines changed
Expand file tree Collapse file tree 1 file changed +6
-33
lines changed Original file line number Diff line number Diff line change 1- import LocalFile from './localFile.ts'
2- import RemoteFile from './remoteFile.ts'
3-
4- import type { FilehandleOptions , GenericFilehandle } from './filehandle.ts'
5-
6- export * from './filehandle.ts'
7-
8- function fromUrl (
9- source : string ,
10- opts : FilehandleOptions = { } ,
11- ) : GenericFilehandle {
12- return new RemoteFile ( source , opts )
13- }
14- function open (
15- maybeUrl ?: string ,
16- maybePath ?: string ,
17- maybeFilehandle ?: GenericFilehandle ,
18- opts : FilehandleOptions = { } ,
19- ) : GenericFilehandle {
20- if ( maybeFilehandle !== undefined ) {
21- return maybeFilehandle
22- }
23- if ( maybeUrl !== undefined ) {
24- return fromUrl ( maybeUrl , opts )
25- }
26- if ( maybePath !== undefined ) {
27- return new LocalFile ( maybePath , opts )
28- }
29- throw new Error ( 'no url, path, or filehandle provided, cannot open' )
30- }
31-
32- export { fromUrl , open }
331export { default as BlobFile } from './blobFile.ts'
342export { default as RemoteFile } from './remoteFile.ts'
353export { default as LocalFile } from './localFile.ts'
364
37- export { type GenericFilehandle } from './filehandle.ts'
5+ export type {
6+ GenericFilehandle ,
7+ Stats ,
8+ Fetcher ,
9+ FilehandleOptions ,
10+ } from './filehandle.ts'
You can’t perform that action at this time.
0 commit comments