redactUrl static method

void redactUrl(
  1. Map<String, dynamic> map,
  2. RedactionService redactor, {
  3. String key = NetworkJsonKeys.url,
})

Redacts a URL field by applying RedactionService.redactUrl.

No-op if the field is absent or not a String.

Implementation

static void redactUrl(
  Map<String, dynamic> map,
  RedactionService redactor, {
  String key = NetworkJsonKeys.url,
}) {
  final value = map[key];
  if (value is String) {
    map[key] = redactor.redactUrl(value);
  }
}