mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
Fix indexeddb file system readdir to use a range
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { ExternalFileSystem } from '@spyglassmc/core'
|
||||
import * as zip from '@zip.js/zip.js'
|
||||
import type { Identifier, NbtTag, Random } from 'deepslate'
|
||||
import { Matrix3, Matrix4, NbtByte, NbtCompound, NbtDouble, NbtInt, NbtList, NbtString, Vector } from 'deepslate'
|
||||
@@ -635,3 +636,12 @@ export function safeJsonParse(text: string): any {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
export async function clearFolder(fs: ExternalFileSystem, uri: string) {
|
||||
const entries = await fs.readdir(uri)
|
||||
return Promise.all(entries.map(async e => {
|
||||
if (e.name !== uri) {
|
||||
return await fs.unlink(e.name)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user