@ai-matrx/records 0.87.12 → 0.87.14

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.
@@ -223,6 +223,14 @@ function defineTypedTable(input) {
223
223
  if (!/^\d{4}-\d{2}-\d{2}$/.test(c.approval.approvedOn ?? "")) refuse(slug, "the approval names the day it was given (YYYY-MM-DD).");
224
224
  if (!c.approval.covers?.trim()) refuse(slug, "the approval says what it covers.");
225
225
  }
226
+ const seenLabels = /* @__PURE__ */ new Map();
227
+ for (const [fieldKey, def] of entries) {
228
+ const label = (def.label ?? labelFor(fieldKey)).trim();
229
+ const norm = label.replace(/\s+/g, " ").toLowerCase();
230
+ const other = seenLabels.get(norm);
231
+ if (other !== void 0) refuse(slug, `two fields called ${JSON.stringify(other.label)} (${other.key} and ${fieldKey}); the store refuses a second column with a label it already has.`);
232
+ seenLabels.set(norm, { key: fieldKey, label });
233
+ }
226
234
  const specs = entries.map(([fieldKey, def], i) => ({
227
235
  key: fieldKey,
228
236
  label: def.label ?? labelFor(fieldKey),