getFilter method

FilterFunction? getFilter(
  1. String name
)

Gets the filter function registered with the given name.

This method retrieves a filter function, checking local registrations first, then falling back to the global FilterRegistry. If the filter is not found in either location, it returns null.

name The name of the filter function to retrieve. return The filter function registered with the given name, or null if not found.

Implementation

FilterFunction? getFilter(String name) {
  // Check local filters first
  final localFilters = _registers['filters'] as Map<String, FilterFunction>?;
  if (localFilters?.containsKey(name) == true) {
    return localFilters![name];
  }

  // In strict mode, don't check global registry
  if (_strictMode) {
    return null;
  }

  // Fall back to global registry
  return FilterRegistry.getFilter(name);
}