Enforces the invariants the output keying depends on: every short name is present, filesystem-safe (unchanged by .slug(), so refCode round-trips), no longer than max_len, and unique — globally, or within each level of by (used for the per-tenure landbase codes, which need only be unique inside their tenure).

validateShortNames(
  x,
  what = "NAME_SHORT",
  max_len = .maxShortNameLength,
  by = NULL
)

Arguments

x

character vector of candidate short names.

what

character used in error messages to name the table being validated.

max_len

integer maximum permitted length (default 16).

by

optional grouping vector the same length as x; uniqueness is then required only within each group.

Value

x, invisibly, if every check passes; otherwise an error.