applyMergePaths static method

void applyMergePaths(
  1. Map<String, dynamic> target,
  2. Map<String, dynamic> paths, {
  3. required String sourceLabel,
  4. required String apiName,
})

Implementation

static void applyMergePaths(
  Map<String, dynamic> target,
  Map<String, dynamic> paths, {
  required String sourceLabel,
  required String apiName,
}) {
  for (final entry in paths.entries) {
    try {
      setPath(target, entry.key, deepCopy(entry.value));
    } on FormatException catch (error) {
      throw EnsembleTestFailure(
        'API mock "$apiName" in "$sourceLabel" has invalid $mergeKey path '
        '"${entry.key}": ${error.message}',
      );
    }
  }
}