@teselagen/ui 0.8.6-beta.17 → 0.8.6-beta.19

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/index.cjs.js CHANGED
@@ -20230,14 +20230,15 @@ function getQueryParams({
20230
20230
  __name(getQueryParams, "getQueryParams");
20231
20231
  function prepEntitiesForLocalFilter({ entities, ccFields }) {
20232
20232
  const r2 = entities.map((entity) => {
20233
+ const newEnt = __spreadValues({}, entity);
20233
20234
  forEach(ccFields, ({ getValueToFilterOn, path: path2 }) => {
20234
20235
  if (getValueToFilterOn) {
20235
- entity["___original___" + path2] = entity[path2];
20236
- const value = getValueToFilterOn(entity);
20237
- entity[path2] = value;
20236
+ newEnt["___original___" + path2] = newEnt[path2];
20237
+ const value = getValueToFilterOn(newEnt);
20238
+ newEnt[path2] = value;
20238
20239
  }
20239
20240
  });
20240
- return entity;
20241
+ return newEnt;
20241
20242
  });
20242
20243
  return r2;
20243
20244
  }
package/index.es.js CHANGED
@@ -20212,14 +20212,15 @@ function getQueryParams({
20212
20212
  __name(getQueryParams, "getQueryParams");
20213
20213
  function prepEntitiesForLocalFilter({ entities, ccFields }) {
20214
20214
  const r2 = entities.map((entity) => {
20215
+ const newEnt = __spreadValues({}, entity);
20215
20216
  forEach(ccFields, ({ getValueToFilterOn, path: path2 }) => {
20216
20217
  if (getValueToFilterOn) {
20217
- entity["___original___" + path2] = entity[path2];
20218
- const value = getValueToFilterOn(entity);
20219
- entity[path2] = value;
20218
+ newEnt["___original___" + path2] = newEnt[path2];
20219
+ const value = getValueToFilterOn(newEnt);
20220
+ newEnt[path2] = value;
20220
20221
  }
20221
20222
  });
20222
- return entity;
20223
+ return newEnt;
20223
20224
  });
20224
20225
  return r2;
20225
20226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.8.6-beta.17",
3
+ "version": "0.8.6-beta.19",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1216,5 +1216,4 @@ describe("filterLocalEntitiesToHasura", () => {
1216
1216
  ]);
1217
1217
  expect(result.entityCount).toBe(5);
1218
1218
  });
1219
-
1220
1219
  });
@@ -420,15 +420,16 @@ export function getQueryParams({
420
420
  function prepEntitiesForLocalFilter({ entities, ccFields }) {
421
421
  // Prepare entities for local filtering by mapping over them and applying necessary transformations
422
422
  const r = entities.map(entity => {
423
+ const newEnt = { ...entity };
423
424
  // Apply any necessary transformations using ccFields
424
425
  forEach(ccFields, ({ getValueToFilterOn, path }) => {
425
426
  if (getValueToFilterOn) {
426
- entity["___original___" + path] = entity[path]
427
- const value = getValueToFilterOn(entity);
428
- entity[path] = value;
427
+ newEnt["___original___" + path] = newEnt[path];
428
+ const value = getValueToFilterOn(newEnt);
429
+ newEnt[path] = value;
429
430
  }
430
431
  });
431
- return entity;
432
+ return newEnt;
432
433
  });
433
434
  return r;
434
435
  }