extractClassesToGenerateSerializersFor function

ClassesToGenerateSerializersFor extractClassesToGenerateSerializersFor(
  1. LibraryElement externalSchemaLibrary
)

Implementation

ClassesToGenerateSerializersFor extractClassesToGenerateSerializersFor(
    LibraryElement externalSchemaLibrary) {
  final builtClasses = externalSchemaLibrary.units
      .expand((cu) => cu.classes)
      .where((c) => hasSerializer(c) && isBuiltValue(c))
      .toSet();

  final nonBuiltClasses = externalSchemaLibrary.units
      .expand((cu) => cu.classes)
      .where(
        (c) => hasSerializer(c) && !isBuiltValue(c),
      )
      .toSet();

  return (
    builtClasses: builtClasses,
    nonBuiltClasses: nonBuiltClasses,
  );
}