File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ export async function check(code: Promisable<number>): Promise<void> {
10
10
export function ignoredDataView ( ) : DataView {
11
11
return new DataView ( new ArrayBuffer ( 4 ) )
12
12
}
13
- export async function getHandleFromPath ( path : string ) : Promise < FileSystemFileHandle > {
13
+
14
+ export async function getHandleFromPath ( path : string , create ?: boolean ) : Promise < FileSystemFileHandle > {
14
15
const root = await navigator . storage . getDirectory ( )
15
- const handle = await root . getFileHandle ( path , { create : true } )
16
- return handle
16
+ return await root . getFileHandle ( path , { create } )
17
17
}
18
18
19
19
export function isOpfsVFS ( vfs : FacadeVFS ) : boolean {
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ async function importDatabaseToOpfs(
124
124
path : string ,
125
125
source : ReadableStream < Uint8Array > ,
126
126
) : Promise < void > {
127
- const handle = await getHandleFromPath ( path )
127
+ const handle = await getHandleFromPath ( path , true )
128
128
const [ streamForVerify , streamData ] = source . tee ( )
129
129
130
130
await parseHeaderAndVerify ( streamForVerify . getReader ( ) )
You can’t perform that action at this time.
0 commit comments