import 'package:angel3_container/angel3_container.dart'; final RegExp straySlashes = RegExp(r'(^/+)|(/+$)'); T? matchingAnnotation(List metadata) { for (var metaDatum in metadata) { if (metaDatum.type.reflectedType == T) { return metaDatum.reflectee as T?; } } return null; } T? getAnnotation(obj, Reflector? reflector) { if (reflector == null) { return null; } else { if (obj is Function) { var methodMirror = reflector.reflectFunction(obj)!; return matchingAnnotation(methodMirror.annotations); } else { var classMirror = reflector.reflectClass(obj.runtimeType)!; return matchingAnnotation(classMirror.annotations); } } }