@zenfs/core 2.6.6 → 2.7.1
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/memory.d.ts +1 -1
- package/dist/backends/store/fs.js +4 -4
- package/dist/config.js +7 -7
- package/dist/internal/contexts.d.ts +4 -0
- package/dist/internal/contexts.js +10 -6
- package/dist/internal/filesystem.d.ts +5 -0
- package/dist/internal/filesystem.js +18 -0
- package/dist/internal/inode.d.ts +6 -1
- package/dist/internal/inode.js +15 -4
- package/dist/internal/ioctl.d.ts +148 -0
- package/dist/internal/ioctl.js +368 -0
- package/dist/mixins/async.js +6 -1
- package/dist/mixins/mutexed.d.ts +3 -0
- package/dist/mixins/mutexed.js +29 -1
- package/dist/mixins/shared.d.ts +1 -1
- package/dist/mixins/shared.js +1 -0
- package/dist/mixins/sync.js +3 -0
- package/dist/node/async.js +3 -3
- package/dist/node/promises.js +16 -16
- package/dist/node/sync.js +23 -23
- package/dist/vfs/async.js +10 -10
- package/dist/vfs/file.d.ts +11 -1
- package/dist/vfs/file.js +26 -4
- package/dist/vfs/ioctl.d.ts +8 -85
- package/dist/vfs/ioctl.js +67 -369
- package/dist/vfs/shared.d.ts +2 -0
- package/dist/vfs/shared.js +12 -8
- package/dist/vfs/sync.d.ts +1 -1
- package/dist/vfs/sync.js +19 -19
- package/dist/vfs/watchers.js +1 -1
- package/dist/vfs/xattr.js +8 -8
- package/package.json +10 -1
- package/tests/common/utf8stream.test.ts +1 -1
- package/tests/fs/permissions.test.ts +1 -1
package/dist/vfs/watchers.js
CHANGED
|
@@ -151,7 +151,7 @@ export function emitChange(context, eventType, filename) {
|
|
|
151
151
|
const $ = contextOf(context);
|
|
152
152
|
if ($)
|
|
153
153
|
filename = join($.root ?? '/', filename);
|
|
154
|
-
filename = normalizePath(filename);
|
|
154
|
+
filename = normalizePath.call(context, filename);
|
|
155
155
|
// Notify watchers, including ones on parent directories if they are watching recursively.
|
|
156
156
|
for (let path = filename;; path = dirname(path)) {
|
|
157
157
|
const watchersForPath = watchers.get(path);
|
package/dist/vfs/xattr.js
CHANGED
|
@@ -17,7 +17,7 @@ function checkName($, name, path, syscall) {
|
|
|
17
17
|
throw UV('ENOTSUP', syscall, path);
|
|
18
18
|
}
|
|
19
19
|
export async function get(path, name, opt = {}) {
|
|
20
|
-
path = normalizePath(path);
|
|
20
|
+
path = normalizePath.call(this, path);
|
|
21
21
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
22
22
|
checkName(this, name, path, 'xattr.get');
|
|
23
23
|
const inode = await fs.stat(resolved).catch(rethrow('xattr.get', path));
|
|
@@ -31,7 +31,7 @@ export async function get(path, name, opt = {}) {
|
|
|
31
31
|
return opt.encoding == 'buffer' || !opt.encoding ? buffer : buffer.toString(opt.encoding);
|
|
32
32
|
}
|
|
33
33
|
export function getSync(path, name, opt = {}) {
|
|
34
|
-
path = normalizePath(path);
|
|
34
|
+
path = normalizePath.call(this, path);
|
|
35
35
|
checkName(this, name, path, 'xattr.get');
|
|
36
36
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
37
37
|
let inode;
|
|
@@ -59,7 +59,7 @@ export function getSync(path, name, opt = {}) {
|
|
|
59
59
|
* @param opt Options for the operation
|
|
60
60
|
*/
|
|
61
61
|
export async function set(path, name, value, opt = {}) {
|
|
62
|
-
path = normalizePath(path);
|
|
62
|
+
path = normalizePath.call(this, path);
|
|
63
63
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
64
64
|
checkName(this, name, path, 'xattr.set');
|
|
65
65
|
const inode = await fs.stat(resolved).catch(rethrow('xattr.set', path));
|
|
@@ -83,7 +83,7 @@ export async function set(path, name, value, opt = {}) {
|
|
|
83
83
|
* @param opt Options for the operation
|
|
84
84
|
*/
|
|
85
85
|
export function setSync(path, name, value, opt = {}) {
|
|
86
|
-
path = normalizePath(path);
|
|
86
|
+
path = normalizePath.call(this, path);
|
|
87
87
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
88
88
|
checkName(this, name, path, 'xattr.set');
|
|
89
89
|
let inode;
|
|
@@ -116,7 +116,7 @@ export function setSync(path, name, value, opt = {}) {
|
|
|
116
116
|
* @param name Name of the attribute to remove
|
|
117
117
|
*/
|
|
118
118
|
export async function remove(path, name) {
|
|
119
|
-
path = normalizePath(path);
|
|
119
|
+
path = normalizePath.call(this, path);
|
|
120
120
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
121
121
|
checkName(this, name, path, 'xattr.remove');
|
|
122
122
|
const inode = await fs.stat(resolved).catch(rethrow('xattr.remove', path));
|
|
@@ -136,7 +136,7 @@ export async function remove(path, name) {
|
|
|
136
136
|
* @param name Name of the attribute to remove
|
|
137
137
|
*/
|
|
138
138
|
export function removeSync(path, name) {
|
|
139
|
-
path = normalizePath(path);
|
|
139
|
+
path = normalizePath.call(this, path);
|
|
140
140
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
141
141
|
checkName(this, name, path, 'xattr.remove');
|
|
142
142
|
let inode;
|
|
@@ -167,7 +167,7 @@ export function removeSync(path, name) {
|
|
|
167
167
|
* @returns Array of attribute names
|
|
168
168
|
*/
|
|
169
169
|
export async function list(path) {
|
|
170
|
-
path = normalizePath(path);
|
|
170
|
+
path = normalizePath.call(this, path);
|
|
171
171
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
172
172
|
const inode = await fs.stat(resolved).catch(rethrow('xattr.list', path));
|
|
173
173
|
if (!inode.attributes)
|
|
@@ -181,7 +181,7 @@ export async function list(path) {
|
|
|
181
181
|
* @returns Array of attribute names
|
|
182
182
|
*/
|
|
183
183
|
export function listSync(path) {
|
|
184
|
-
path = normalizePath(path);
|
|
184
|
+
path = normalizePath.call(this, path);
|
|
185
185
|
const { fs, path: resolved } = resolveMount(path, this);
|
|
186
186
|
let inode;
|
|
187
187
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenfs/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "A filesystem, anywhere",
|
|
5
5
|
"funding": {
|
|
6
6
|
"type": "individual",
|
|
@@ -93,5 +93,14 @@
|
|
|
93
93
|
"typedoc": "^0.28.18",
|
|
94
94
|
"typescript": "^6.0.0",
|
|
95
95
|
"typescript-eslint": "^8.58.0"
|
|
96
|
+
},
|
|
97
|
+
"prettier": {
|
|
98
|
+
"singleQuote": true,
|
|
99
|
+
"useTabs": true,
|
|
100
|
+
"trailingComma": "es5",
|
|
101
|
+
"tabWidth": 4,
|
|
102
|
+
"printWidth": 150,
|
|
103
|
+
"arrowParens": "avoid",
|
|
104
|
+
"experimentalOperatorPosition": "start"
|
|
96
105
|
}
|
|
97
106
|
}
|
|
@@ -54,7 +54,7 @@ suite('Permissions', config('permissions'), () => {
|
|
|
54
54
|
assert.equal(error.code, 'EACCES');
|
|
55
55
|
});
|
|
56
56
|
if (!stats) return;
|
|
57
|
-
assert(hasAccess(defaultContext, stats, X_OK));
|
|
57
|
+
if (stats.isDirectory()) assert(hasAccess(defaultContext, stats, X_OK));
|
|
58
58
|
|
|
59
59
|
function checkError(access: number) {
|
|
60
60
|
return function (error: Exception) {
|