UNPKG

@nevis-security/nevis-mobile-authentication-sdk-react

Version:

React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.

26 lines (24 loc) 1.19 kB
"use strict"; /** * Copyright © 2023 Nevis Security AG. All rights reserved. */ import { PinEnrollmentCustomValidationError } from "./PinEnrollmentCustomValidationError.js"; import { PinEnrollmentInvalidPinFormat } from "./PinEnrollmentInvalidPinFormat.js"; import { ErrorConverter } from "../../ErrorConverter.js"; var PinEnrollmentErrorType = /*#__PURE__*/function (PinEnrollmentErrorType) { PinEnrollmentErrorType[PinEnrollmentErrorType["CustomValidationError"] = 0] = "CustomValidationError"; PinEnrollmentErrorType[PinEnrollmentErrorType["InvalidPinFormat"] = 1] = "InvalidPinFormat"; return PinEnrollmentErrorType; }(PinEnrollmentErrorType || {}); export class PinEnrollmentErrorConverter extends ErrorConverter { convert() { const subtype = PinEnrollmentErrorType[this.error.type]; switch (subtype) { case PinEnrollmentErrorType.CustomValidationError: return new PinEnrollmentCustomValidationError(this.error.description, this.error.cause); case PinEnrollmentErrorType.InvalidPinFormat: return new PinEnrollmentInvalidPinFormat(this.error.description, this.error.cause); } } } //# sourceMappingURL=PinEnrollmentErrorConverter.js.map