@zenfs/core 1.6.9 → 1.6.10
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/emulation/promises.js +2 -1
- package/dist/emulation/sync.d.ts +2 -2
- package/dist/emulation/sync.js +2 -1
- package/package.json +1 -1
- package/readme.md +0 -3
|
@@ -773,7 +773,8 @@ export async function readlink(path, options) {
|
|
|
773
773
|
const handle = __addDisposableResource(env_6, await _open.call(this, normalizePath(path), 'r', 0o644, false), true);
|
|
774
774
|
const value = await handle.readFile();
|
|
775
775
|
const encoding = typeof options == 'object' ? options?.encoding : options;
|
|
776
|
-
|
|
776
|
+
// always defaults to utf-8 to avoid wrangler (cloudflare) worker "unknown encoding" exception
|
|
777
|
+
return encoding == 'buffer' ? value : value.toString((encoding ?? 'utf-8'));
|
|
777
778
|
}
|
|
778
779
|
catch (e_6) {
|
|
779
780
|
env_6.error = e_6;
|
package/dist/emulation/sync.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import type * as fs from 'node:fs';
|
|
3
|
+
import type { V_Context } from '../context.js';
|
|
3
4
|
import type { FileContents } from '../filesystem.js';
|
|
4
5
|
import { BigIntStats, type Stats } from '../stats.js';
|
|
5
6
|
import { Dir, Dirent } from './dir.js';
|
|
6
|
-
import type {
|
|
7
|
-
import type { ReaddirOptsI, ReaddirOptsU, InternalOptions, ReaddirOptions, NullEnc } from './types.js';
|
|
7
|
+
import type { InternalOptions, NullEnc, ReaddirOptions, ReaddirOptsI, ReaddirOptsU } from './types.js';
|
|
8
8
|
export declare function renameSync(this: V_Context, oldPath: fs.PathLike, newPath: fs.PathLike): void;
|
|
9
9
|
/**
|
|
10
10
|
* Test whether or not `path` exists by checking with the file system.
|
package/dist/emulation/sync.js
CHANGED
|
@@ -549,7 +549,8 @@ export function readlinkSync(path, options) {
|
|
|
549
549
|
if (encoding == 'buffer') {
|
|
550
550
|
return value;
|
|
551
551
|
}
|
|
552
|
-
|
|
552
|
+
// always defaults to utf-8 to avoid wrangler (cloudflare) worker "unknown encoding" exception
|
|
553
|
+
return value.toString(encoding ?? 'utf-8');
|
|
553
554
|
}
|
|
554
555
|
readlinkSync;
|
|
555
556
|
export function chownSync(path, uid, gid) {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -147,9 +147,6 @@ fs.umount('/mnt/zip'); // finished using the zip
|
|
|
147
147
|
|
|
148
148
|
### Devices and device files
|
|
149
149
|
|
|
150
|
-
> [!WARNING]
|
|
151
|
-
> This is an **experimental** feature. Breaking changes may occur during non-major releases. Using this feature is the fastest way to make it stable.
|
|
152
|
-
|
|
153
150
|
ZenFS includes experimental support for device files. These are designed to follow Linux's device file behavior, for consistency and ease of use. You can automatically add some normal devices with the `addDevices` configuration option:
|
|
154
151
|
|
|
155
152
|
```ts
|