@rebasepro/client 0.6.0 → 0.6.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.
package/dist/index.umd.js CHANGED
@@ -93,7 +93,7 @@
93
93
  }
94
94
  function serializeLogicalCondition(cond) {
95
95
  if ("type" in cond) {
96
- const sub = cond.conditions.map(serializeLogicalCondition).join(",");
96
+ const sub = (cond.conditions ?? []).map(serializeLogicalCondition).join(",");
97
97
  return `${cond.type}(${sub})`;
98
98
  } else {
99
99
  const op = OP_MAP[cond.operator] ?? cond.operator;
@@ -114,7 +114,7 @@
114
114
  if (params.include && params.include.length > 0) parts.push(`include=${encodeURIComponent(params.include.join(","))}`);
115
115
  if (params.logical) {
116
116
  const root = params.logical;
117
- const serialized = root.conditions.map(serializeLogicalCondition).join(",");
117
+ const serialized = (root.conditions ?? []).map(serializeLogicalCondition).join(",");
118
118
  parts.push(`${root.type}=${encodeURIComponent(`(${serialized})`)}`);
119
119
  }
120
120
  if (params.where) for (const [field, value] of Object.entries(params.where)) if (Array.isArray(value) && value.length > 0 && Array.isArray(value[0])) for (const subVal of value) {