@componentor/fs 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +199 -236
- package/dist/index.js.map +1 -1
- package/dist/opfs-hybrid.js +199 -236
- package/dist/opfs-hybrid.js.map +1 -1
- package/dist/opfs-worker.js +199 -236
- package/dist/opfs-worker.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +26 -14
- package/src/packed-storage.ts +209 -262
- package/src/symlink-manager.ts +8 -5
package/src/symlink-manager.ts
CHANGED
|
@@ -102,12 +102,15 @@ export class SymlinkManager {
|
|
|
102
102
|
|
|
103
103
|
if (this.useSync) {
|
|
104
104
|
const access = await fileHandle.createSyncAccessHandle()
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
written
|
|
105
|
+
try {
|
|
106
|
+
access.truncate(0)
|
|
107
|
+
let written = 0
|
|
108
|
+
while (written < buffer.length) {
|
|
109
|
+
written += access.write(buffer.subarray(written), { at: written })
|
|
110
|
+
}
|
|
111
|
+
} finally {
|
|
112
|
+
access.close()
|
|
109
113
|
}
|
|
110
|
-
access.close()
|
|
111
114
|
} else {
|
|
112
115
|
const writable = await fileHandle.createWritable()
|
|
113
116
|
await writable.write(buffer)
|