processMap method

Future<Map<String, dynamic>> processMap(
  1. Map<String, dynamic> json
)

Processes all values in a JSON map by substituting variables.

This method takes each value in the provided map, converts it to a string, and processes it for variable substitution.

Parameters:

  • json - A map containing key-value pairs to process

Returns a new map with all values processed for variable substitution.

Implementation

Future<Map<String, dynamic>> processMap(Map<String, dynamic> json) async {
  Map<String, dynamic> processedMap = {};
  for (var key in json.keys) {
    final value = json[key];
    // `null.toString()` is the four-character string "null", which then
    // passes every `isNotEmpty` check downstream. That is how an unset
    // `target-commitish` reached the GitHub API as a literal "null" branch.
    processedMap[key] =
        value == null ? null : await process(value.toString());
  }
  return processedMap;
}