# wrapToDocumentType function

GenericDocumentWrapper wrapToDocumentType(

1. GenericDocument document

)

## Implementation

    GenericDocumentWrapper wrapToDocumentType(GenericDocument document) {
      switch (document.type?.name) {
        case MRZ.DOCUMENT_TYPE:
          return MRZ(document);

        case DeIdCardFront.DOCUMENT_TYPE:
          return DeIdCardFront(document);

        case DeIdCardBack.DOCUMENT_TYPE:
          return DeIdCardBack(document);

        case DePassport.DOCUMENT_TYPE:
          return DePassport(document);

        case DeDriverLicenseFront.DOCUMENT_TYPE:
          return DeDriverLicenseFront(document);

        case DeDriverLicenseBack.DOCUMENT_TYPE:
          return DeDriverLicenseBack(document);
        default:
          return GenericDocumentWrapper(document);
      }
    }