process method
Implementation
String process(String jsonString, Map<String, dynamic> data,
{Map<String, String>? templates}) {
// Remove comments before processing
final jsonWithoutComments = _removeComments(jsonString);
// Convert JSON string to Dart object (Map or List)
final decodedJson = json.decode(jsonWithoutComments);
// Recursively replace placeholders
final processedJson = _replacePlaceholdersRecursive(
decodedJson,
data,
templates,
);
// Convert Dart object back to JSON string
return json.encode(processedJson);
}