@ai-matrx/records 0.87.11 → 0.87.13

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.
@@ -286,6 +286,14 @@ function defineTypedTable(input) {
286
286
  if (!/^\d{4}-\d{2}-\d{2}$/.test(c.approval.approvedOn ?? "")) refuse(slug, "the approval names the day it was given (YYYY-MM-DD).");
287
287
  if (!c.approval.covers?.trim()) refuse(slug, "the approval says what it covers.");
288
288
  }
289
+ const seenLabels = /* @__PURE__ */ new Map();
290
+ for (const [fieldKey, def] of entries) {
291
+ const label = (def.label ?? labelFor(fieldKey)).trim();
292
+ const norm = label.replace(/\s+/g, " ").toLowerCase();
293
+ const other = seenLabels.get(norm);
294
+ 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.`);
295
+ seenLabels.set(norm, { key: fieldKey, label });
296
+ }
289
297
  const specs = entries.map(([fieldKey, def], i) => ({
290
298
  key: fieldKey,
291
299
  label: def.label ?? labelFor(fieldKey),