@poe-platform/safe-fs 0.1.67 → 0.1.69

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.
@@ -98,17 +98,19 @@ export function withFileSystemQuota(fs, options) {
98
98
  });
99
99
  },
100
100
  };
101
- return new Proxy(fs, {
102
- get(target, property) {
101
+ // Backend descriptors may be frozen. An independent view lets us adapt
102
+ // capabilities and methods without violating invariants on own properties.
103
+ return new Proxy(Object.create(fs), {
104
+ get(_target, property) {
103
105
  if (property === "capabilities")
104
- return quotaCapabilities(target.capabilities);
106
+ return quotaCapabilities(fs.capabilities);
105
107
  if (property === "capabilitiesFor")
106
- return async (path, fsOptions) => quotaCapabilities(await target.capabilitiesFor?.(path, fsOptions) ?? target.capabilities);
108
+ return async (path, fsOptions) => quotaCapabilities(await fs.capabilitiesFor?.(path, fsOptions) ?? fs.capabilities);
107
109
  const replacement = Reflect.get(mutations, property);
108
110
  if (typeof replacement === "function")
109
111
  return replacement;
110
- const original = Reflect.get(target, property);
111
- return typeof original === "function" ? original.bind(target) : original;
112
+ const original = Reflect.get(fs, property);
113
+ return typeof original === "function" ? original.bind(fs) : original;
112
114
  },
113
115
  });
114
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-fs",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "description": "Composable filesystem with a portable core and explicit Node adapters",
5
5
  "type": "module",
6
6
  "license": "MIT",