UNPKG

@adyen/kyc-components

Version:

This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.

22 lines (21 loc) 1.12 kB
try { let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack; n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ebc2b9dc-46c5-4bce-aa60-c2eb333409fd", e._sentryDebugIdIdentifier = "sentry-dbid-ebc2b9dc-46c5-4bce-aa60-c2eb333409fd"); } catch (e) {} var filterProblemsByTaskForms = (entityProblems, forms) => { if (!entityProblems?.verificationErrors) return entityProblems; const filteredEntityProblems = Object.entries(entityProblems.verificationErrors).reduce((acc, [formId, verificationErrors]) => { if (!forms.includes(formId)) return acc; return { ...entityProblems, verificationErrors: { ...acc.verificationErrors, [formId]: verificationErrors } }; }, {}); filteredEntityProblems.verificationErrors = Object.keys(filteredEntityProblems.verificationErrors ?? {}).length > 0 ? filteredEntityProblems.verificationErrors : void 0; return filteredEntityProblems; }; //#endregion export { filterProblemsByTaskForms as t };