@zenfs/core 1.6.6 → 1.6.8
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/backends/backend.d.ts +1 -1
- package/dist/backends/backend.js +1 -1
- package/dist/backends/memory.d.ts +0 -1
- package/dist/backends/memory.js +0 -3
- package/dist/backends/overlay.d.ts +0 -1
- package/dist/backends/overlay.js +0 -3
- package/dist/backends/port/fs.d.ts +0 -1
- package/dist/backends/port/fs.js +0 -3
- package/dist/backends/store/fs.d.ts +1 -1
- package/dist/backends/store/fs.js +1 -1
- package/dist/{inode.d.ts → backends/store/inode.d.ts} +1 -1
- package/dist/{inode.js → backends/store/inode.js} +2 -2
- package/dist/config.js +1 -1
- package/dist/emulation/sync.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +3 -3
- package/dist/lib.d.ts +0 -1
- package/dist/lib.js +0 -2
|
@@ -61,7 +61,7 @@ export interface Backend<FS extends FileSystem = FileSystem, TOptions extends ob
|
|
|
61
61
|
* 'false' if the API is unavailable
|
|
62
62
|
*
|
|
63
63
|
*/
|
|
64
|
-
isAvailable(): boolean | Promise<boolean>;
|
|
64
|
+
isAvailable?(): boolean | Promise<boolean>;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Gets the options type of a backend
|
package/dist/backends/backend.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ErrnoError, Errno } from '../error.js';
|
|
|
2
2
|
import { levenshtein } from '../utils.js';
|
|
3
3
|
/** @internal */
|
|
4
4
|
export function isBackend(arg) {
|
|
5
|
-
return arg != null && typeof arg == 'object' && '
|
|
5
|
+
return arg != null && typeof arg == 'object' && 'create' in arg && typeof arg.create == 'function';
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Checks that `options` object is valid for the file system options.
|
package/dist/backends/memory.js
CHANGED
package/dist/backends/overlay.js
CHANGED
package/dist/backends/port/fs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { File } from '../../file.js';
|
|
2
2
|
import { FileSystem, type FileSystemMetadata } from '../../filesystem.js';
|
|
3
|
-
import { Inode } from '
|
|
3
|
+
import { Inode } from './inode.js';
|
|
4
4
|
import type { Stats } from '../../stats.js';
|
|
5
5
|
import type { Store, Transaction } from './store.js';
|
|
6
6
|
/**
|
|
@@ -56,7 +56,7 @@ import { basename, dirname, parse, resolve } from '../../emulation/path.js';
|
|
|
56
56
|
import { Errno, ErrnoError } from '../../error.js';
|
|
57
57
|
import { PreloadFile } from '../../file.js';
|
|
58
58
|
import { FileSystem } from '../../filesystem.js';
|
|
59
|
-
import { Inode, rootIno } from '
|
|
59
|
+
import { Inode, rootIno } from './inode.js';
|
|
60
60
|
import { decodeDirListing, encodeDirListing, encodeUTF8, randomBigInt } from '../../utils.js';
|
|
61
61
|
import { serialize } from 'utilium';
|
|
62
62
|
const maxInodeAllocTries = 5;
|
|
@@ -37,8 +37,8 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
|
|
|
37
37
|
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
38
38
|
};
|
|
39
39
|
import { deserialize, sizeof, struct, types as t } from 'utilium';
|
|
40
|
-
import { Stats } from '
|
|
41
|
-
import { randomBigInt } from '
|
|
40
|
+
import { Stats } from '../../stats.js';
|
|
41
|
+
import { randomBigInt } from '../../utils.js';
|
|
42
42
|
/**
|
|
43
43
|
* Room inode
|
|
44
44
|
* @hidden
|
package/dist/config.js
CHANGED
|
@@ -41,7 +41,7 @@ export async function resolveMountConfig(configuration, _depth = 0) {
|
|
|
41
41
|
configuration[key] = await resolveMountConfig(value, ++_depth);
|
|
42
42
|
}
|
|
43
43
|
const { backend } = configuration;
|
|
44
|
-
if (!(await backend.isAvailable())) {
|
|
44
|
+
if (typeof backend.isAvailable == 'function' && !(await backend.isAvailable())) {
|
|
45
45
|
throw new ErrnoError(Errno.EPERM, 'Backend not available: ' + backend.name);
|
|
46
46
|
}
|
|
47
47
|
await checkOptions(backend, configuration);
|
package/dist/emulation/sync.js
CHANGED
|
@@ -518,7 +518,7 @@ export function linkSync(targetPath, linkPath) {
|
|
|
518
518
|
if (config.checkAccess && !fs.statSync(path).hasAccess(constants.R_OK, this)) {
|
|
519
519
|
throw ErrnoError.With('EACCES', path, 'link');
|
|
520
520
|
}
|
|
521
|
-
return fs.linkSync(path,
|
|
521
|
+
return fs.linkSync(path, link.path);
|
|
522
522
|
}
|
|
523
523
|
catch (e) {
|
|
524
524
|
throw fixError(e, { [path]: targetPath, [link.path]: linkPath });
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from './credentials.js';
|
|
|
14
14
|
export * from './devices.js';
|
|
15
15
|
export * from './file.js';
|
|
16
16
|
export * from './filesystem.js';
|
|
17
|
-
export * from './inode.js';
|
|
17
|
+
export * from './backends/store/inode.js';
|
|
18
18
|
export * from './mixins/index.js';
|
|
19
19
|
export * from './stats.js';
|
|
20
20
|
export * from './utils.js';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export * from './credentials.js';
|
|
|
14
14
|
export * from './devices.js';
|
|
15
15
|
export * from './file.js';
|
|
16
16
|
export * from './filesystem.js';
|
|
17
|
-
export * from './inode.js';
|
|
17
|
+
export * from './backends/store/inode.js';
|
|
18
18
|
export * from './mixins/index.js';
|
|
19
19
|
export * from './stats.js';
|
|
20
20
|
export * from './utils.js';
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# ZenFS
|
|
2
2
|
|
|
3
|
-
ZenFS is a file system that emulates the [NodeJS filesystem API](http://nodejs.org/api/fs.html).
|
|
4
|
-
|
|
5
|
-
It works using a system of backends, which are used by ZenFS to store and retrieve data. ZenFS can also integrate with other tools.
|
|
3
|
+
ZenFS is a file system that emulates the [NodeJS filesystem API](http://nodejs.org/api/fs.html). It works using a system of backends, which are used by ZenFS to store and retrieve data. ZenFS can also integrate with other tools.
|
|
6
4
|
|
|
7
5
|
## Backends
|
|
8
6
|
|
|
@@ -27,6 +25,8 @@ For more information, see the [docs](https://zenfs.dev/core).
|
|
|
27
25
|
npm install @zenfs/core
|
|
28
26
|
```
|
|
29
27
|
|
|
28
|
+
If you're using ZenFS, especially for big projects, please consider supporting the project. Thousands of hours have been dedicated to its development, and your acknowledgment or financial support would go a long way toward improving ZenFS and its community.
|
|
29
|
+
|
|
30
30
|
## Usage
|
|
31
31
|
|
|
32
32
|
```js
|
package/dist/lib.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/lib.js
DELETED