CleanerFunction<T> typedef

CleanerFunction<T> = T Function(Data data, Map<String, Object> extractedData, bool debug)

Function signature for custom data cleaning functions.

This typedef defines the signature that all cleaner functions must follow. Cleaner functions are called after data extraction and transformation to perform custom data processing, validation, or cleaning.

Parameters:

  • data: The data to clean, containing URL and extracted content
  • debug: Whether debug mode is enabled for logging

Returns:

  • Cleaned data of any type, or null if cleaning fails

Example:

CleanerFunction myCleaner = (Data data, bool debug) {
  if (data.obj is String) {
    return (data.obj as String).trim().toLowerCase();
  }
  return null;
};

Implementation

typedef CleanerFunction<T> = T Function(
    Data data, Map<String, Object> extractedData, bool debug);