unwrapDirectiveInstance function

Expression? unwrapDirectiveInstance(
  1. Expression? directiveInstance
)

Implementation

o.Expression? unwrapDirectiveInstance(o.Expression? directiveInstance) {
  if (directiveInstance is o.ReadPropExpr &&
      directiveInstance.name == 'instance' &&
      (directiveInstance.receiver is o.ReadClassMemberExpr ||
          directiveInstance.receiver is o.ReadPropExpr)) {
    return directiveInstance.receiver;
  }
  return null;
}