querysub 0.168.0 → 0.169.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.168.0",
3
+ "version": "0.169.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -1141,10 +1141,17 @@ export class PathValueProxyWatcher {
1141
1141
  },
1142
1142
  }) as Result;
1143
1143
 
1144
- // NOTE: Always deep clone. It's too confusing for a partial object to be returned. Any issues caused by
1144
+ // NOTE: Deep clone non-local paths. It's too confusing for a partial object to be returned. Any issues caused by
1145
1145
  // this (aka, returning the entire database), would also happen if we manually added deep clones before
1146
1146
  // we returned values (and both should be throttled at a framework level so we don't break the database).
1147
- rawResult = deepCloneCborx(rawResult);
1147
+ // - For local paths there is a risk that there are functions
1148
+ try {
1149
+ rawResult = deepCloneCborx(rawResult);
1150
+ } catch {
1151
+ // Unfortunately, cborx throws on functions.
1152
+ // TODO: Use a recursive clone technique that doesn't throw on functions
1153
+ rawResult = atomicObjectRead(rawResult);
1154
+ }
1148
1155
 
1149
1156
  result = { result: rawResult };
1150
1157
  watcher.consecutiveErrors = 0;