isDanglingReference function

bool isDanglingReference(
  1. Object? data,
  2. NormalizationConfig config
)

Determines whether the given data is a reference that points to a non-existent object.

Implementation

bool isDanglingReference(
  Object? data,
  NormalizationConfig config,
) {
  if (data is Map && data.containsKey(config.referenceKey)) {
    final referencedData = config.read(data[config.referenceKey]);
    if (referencedData == null) return true;
  }
  return false;
}