← Files DataARCHIVED FILE

output_formats/html/scripts/filter-definition-diagnostics.mjs

767 Bytes · Nov 27, 2026 · 12:12 UTC

↓ Download file

/** Snapshot filter choices come from reviewed rows, not a separate options list. */
export function filterDefinitionDiagnostics(filters) {
  if (!Array.isArray(filters)) return [];
  return filters.flatMap((filter, index) => {
    if (!filter || typeof filter !== "object" || !Object.hasOwn(filter, "options")) return [];
    return [{
      code: "DATA_FILTER_OPTIONS_UNSUPPORTED",
      message: `Filter ${JSON.stringify(filter.id ?? index + 1)}: options is unsupported and would be ignored. Choices come from the filter field in its queryIds (or all queries). To include a category with no fact rows, add a separate reviewed dimension query and include it in queryIds; do not invent zero-valued facts. See docs/components/controls/filtering.md.`,
    }];
  });
}

SHA-256: 7de1bb6fa26c1056a19ecd2c8414143c35b9906c223861d5510336c43b0eea09