redactParameters static method
Return a copy of data with the value under every key in keys
replaced by mask, at any depth of nested Maps and Lists.
Keys match case-insensitively. A matching key masks its whole value,
structured or not. An empty value (null, false, an empty string or
collection) stays visible: it is not a secret, and seeing it explains a
validation failure. A subtree nested past 64 levels is masked whole.
data is never mutated; a scalar comes back as is.
Implementation
static Object? redactParameters(Object? data, Set<String> keys) =>
_redact(data, keys.map(_normalize).toSet());