toLoadResult method
The candidate as OkfBundleLoader.inspect would read it once committed.
Source files that failed to load and that the candidate does not replace keep their findings in OkfBundleLoadResult.report, so downstream checks see the same inventory a later load would.
Implementation
OkfBundleLoadResult toLoadResult() {
List<String> sorted(Iterable<String> paths) => paths.toList()..sort();
final documents = <String, OkfDocument>{
for (final path in sorted(concepts.keys))
path: OkfDocument.parse(concepts[path]!, sourcePath: path),
};
final sortedIndexes = <String, String>{
for (final path in sorted(indexes.keys)) path: indexes[path]!,
};
final sortedLogs = <String, String>{
for (final path in sorted(logs.keys)) path: logs[path]!,
};
final sortedAssets = sorted(assets);
return OkfBundleLoadResult(
rootPath: _rootPath,
bundle: OkfBundle.fromDocuments(
documents,
indexes: sortedIndexes,
logs: sortedLogs,
assets: sortedAssets,
),
documents: documents,
indexes: sortedIndexes,
logs: sortedLogs,
assets: sortedAssets,
report: _loadReport,
);
}