LCOV - code coverage report
Current view: top level - src - type_processor.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 16 16 100.0 %
Date: 2020-01-29 07:35:46 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:analyzer/dart/constant/value.dart';
       2             : import 'package:analyzer/dart/element/element.dart';
       3             : import 'package:source_gen/source_gen.dart';
       4             : import 'package:super_enum/super_enum.dart';
       5             : 
       6           2 : TypeChecker _typeChecker(Type t) => TypeChecker.fromRuntime(t);
       7             : 
       8           1 : String dataFieldType(obj) =>
       9           4 :     ConstantReader(obj).read('type').typeValue.toString();
      10             : 
      11           4 : String dataFieldName(obj) => ConstantReader(obj).read('name').stringValue;
      12             : 
      13           1 : ConstantReader annotationOf<T>(obj) =>
      14           3 :     ConstantReader(_typeChecker(T).firstAnnotationOfExact(obj));
      15             : 
      16           1 : ConstantReader fieldOf<T>(obj, String fieldName) =>
      17           2 :     annotationOf<T>(obj)?.read(fieldName);
      18             : 
      19           1 : Iterable listTypeFieldOf<T>(obj, String fieldName) =>
      20           2 :     fieldOf<T>(obj, fieldName)?.listValue ?? [];
      21             : 
      22           3 : bool hasAnnotation<T>(obj) => _typeChecker(T).hasAnnotationOfExact(obj);
      23             : 
      24           1 : bool isGeneric(Element element) =>
      25           2 :     _typeChecker(Generic).hasAnnotationOfExact(element);
      26             : 
      27           1 : DartObject usedClassFromAnnotation(FieldElement field) {
      28             :   final annotation =
      29           2 :       TypeChecker.fromRuntime(UseClass).firstAnnotationOfExact(field);
      30             :   if (annotation == null) return null;
      31           1 :   final DartObject usedClass = annotation.getField('type');
      32             :   return usedClass;
      33             : }

Generated by: LCOV version 1.13