btca-server 1.0.87 → 1.0.89
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/package.json +1 -1
- package/src/vfs/virtual-fs.ts +10 -2
package/package.json
CHANGED
package/src/vfs/virtual-fs.ts
CHANGED
|
@@ -152,8 +152,16 @@ export namespace VirtualFs {
|
|
|
152
152
|
return getInstance(vfsId).readFileBuffer(normalize(filePath));
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
export async function writeFile(
|
|
156
|
-
|
|
155
|
+
export async function writeFile(
|
|
156
|
+
filePath: string,
|
|
157
|
+
data: string | ArrayBufferView,
|
|
158
|
+
vfsId?: string
|
|
159
|
+
) {
|
|
160
|
+
const content =
|
|
161
|
+
typeof data === 'string'
|
|
162
|
+
? data
|
|
163
|
+
: new Uint8Array(data.buffer as ArrayBufferLike, data.byteOffset, data.byteLength);
|
|
164
|
+
await getInstance(vfsId).writeFile(normalize(filePath), content);
|
|
157
165
|
}
|
|
158
166
|
|
|
159
167
|
export async function symlink(targetPath: string, linkPath: string, vfsId?: string) {
|