@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.
@@ -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.6.6",
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
  }
@@ -26,7 +26,7 @@ suite('Utf8Stream', config('write'), () => {
26
26
  assert.equal(stream.maxLength, 32);
27
27
  assert.equal(stream.periodicFlush, 0);
28
28
  assert.equal(stream.mkdir, false);
29
- assert.ok(stream.fd > 0);
29
+ assert.ok(stream.fd >= 0);
30
30
 
31
31
  stream.destroy();
32
32
  });
@@ -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) {