From c7d238128f9e5d9699b5767bcfe0abb5da366b38 Mon Sep 17 00:00:00 2001 From: James Prevett Date: Tue, 10 Dec 2024 12:06:15 -0600 Subject: [PATCH] Fixes to XML, renamed a file (casing) --- src/index.ts | 3 ++- src/{Storage.ts => storage.ts} | 0 src/xml.ts | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) rename src/{Storage.ts => storage.ts} (100%) diff --git a/src/index.ts b/src/index.ts index f827cd1..b5a1b53 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ export * from './access.js'; export * from './IndexedDB.js'; -export * from './Storage.js'; +export * from './storage.js'; +export * from './xml.js'; diff --git a/src/Storage.ts b/src/storage.ts similarity index 100% rename from src/Storage.ts rename to src/storage.ts diff --git a/src/xml.ts b/src/xml.ts index 36166ff..2375719 100644 --- a/src/xml.ts +++ b/src/xml.ts @@ -78,7 +78,7 @@ export class XMLFS extends Sync(FileSystem) { } public statSync(path: string): Stats { - return get_stats(this.get(path, 'stat')); + return get_stats(this.get('stat', path)); } public openFileSync(path: string, flag: string): File { @@ -106,7 +106,8 @@ export class XMLFS extends Sync(FileSystem) { } public mkdirSync(path: string, mode: number): void { - this.create('mkdir', path, { mode: mode | S_IFDIR }); + const node = this.create('mkdir', path, { mode: mode | S_IFDIR }); + node.textContent = '[]'; } public readdirSync(path: string): string[] { @@ -147,7 +148,7 @@ export class XMLFS extends Sync(FileSystem) { const node = this.document.createElement('file'); node.setAttribute('paths', JSON.stringify([path])); set_stats(node, stats); - this.document.append(node); + this.document.documentElement.append(node); return node; } }