**refactor: improve FileSystemStorage compatibility and remove outdated test**
- Modified `storageFactory` to ensure `FileSystemStorage` gracefully degrades to `MemoryStorage` in browser environments, with proper warnings added. - Enhanced `opfsStorage` adapter to support recursive directory removal with the `recursive` option. - Removed `test-fix.js` script, as it is no longer relevant with recent storage fixes and updates. **Purpose**: Streamline and ensure cross-environment compatibility for `FileSystemStorage`, while removing outdated test artifacts for better maintainability.
This commit is contained in:
parent
116d6cea79
commit
db67ccd34f
3 changed files with 17 additions and 24 deletions
|
|
@ -632,7 +632,8 @@ export class OPFSStorage extends BaseStorage {
|
|||
): Promise<void> => {
|
||||
try {
|
||||
for await (const [name, handle] of dirHandle.entries()) {
|
||||
await dirHandle.removeEntry(name)
|
||||
// Use recursive option to handle directories that may contain files
|
||||
await dirHandle.removeEntry(name, { recursive: true })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error removing directory contents:`, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue