@poe-platform/safe-fs 0.1.68 → 0.1.70
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
|
-
|
|
102
|
-
|
|
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(
|
|
106
|
+
return quotaCapabilities(fs.capabilities);
|
|
105
107
|
if (property === "capabilitiesFor")
|
|
106
|
-
return async (path, fsOptions) => quotaCapabilities(await
|
|
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(
|
|
111
|
-
return typeof original === "function" ? original.bind(
|
|
112
|
+
const original = Reflect.get(fs, property);
|
|
113
|
+
return typeof original === "function" ? original.bind(fs) : original;
|
|
112
114
|
},
|
|
113
115
|
});
|
|
114
116
|
}
|