Skip to content

fix: reject empty index fields at the type level#59

Merged
pdlug merged 1 commit into
mainfrom
fix/edge-index-empty-fields-type
Mar 30, 2026
Merged

fix: reject empty index fields at the type level#59
pdlug merged 1 commit into
mainfrom
fix/edge-index-empty-fields-type

Conversation

@pdlug
Copy link
Copy Markdown
Contributor

@pdlug pdlug commented Mar 30, 2026

Summary

  • Changes fields from readonly T[] to readonly [T, ...T[]] in both NodeIndexConfig and EdgeIndexConfig, making fields: [] a compile-time error
  • Also applied the same fix to NodeIndexConfig which had the identical gap
  • Runtime validation in normalizeEdgeIndexFieldsOrThrow / normalizeNodeIndexFieldsOrThrow remains as a safety net

Closes #58

@pdlug pdlug force-pushed the fix/edge-index-empty-fields-type branch from a1e068a to e7d0a86 Compare March 30, 2026 01:43
Change `fields` from `readonly T[]` to `readonly [T, ...T[]]` in both
`NodeIndexConfig` and `EdgeIndexConfig` so that `fields: []` is caught
by the compiler instead of only at runtime.

Closes #58
@pdlug pdlug force-pushed the fix/edge-index-empty-fields-type branch from e7d0a86 to 491f6ae Compare March 30, 2026 01:46
@pdlug pdlug merged commit 36742a1 into main Mar 30, 2026
10 checks passed
@pdlug pdlug deleted the fix/edge-index-empty-fields-type branch March 30, 2026 01:49
@github-actions github-actions Bot mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

defineEdgeIndex should reject empty fields at the type level

1 participant