linter fixes

This commit is contained in:
Artem Vasilev 2022-06-23 13:11:08 +03:00
parent 5b2e237c34
commit 2b8ab994ef
6 changed files with 44 additions and 37 deletions

View File

@ -37,7 +37,7 @@ export const getAllCertificates = _afterPluginsLoaded(
while (containerAllCertificatesCount) { while (containerAllCertificatesCount) {
foundAvailableCertificate = availableCertificates.find( foundAvailableCertificate = availableCertificates.find(
(cert) => cert.thumbprint === containerAllCertificates[containerAllCertificatesCount].thumbprint (cert) => cert.thumbprint === containerAllCertificates[containerAllCertificatesCount].thumbprint,
); );
if (!foundAvailableCertificate) { if (!foundAvailableCertificate) {

View File

@ -1,7 +1,7 @@
import { Certificate } from './certificate'; import { Certificate } from './certificate';
import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded'; import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';
import {getCertificates} from "./getCertificates"; import { getCertificates } from './getCertificates';
import {getAllCertificates} from "./getAllCertificates"; import { getAllCertificates } from './getAllCertificates';
/** /**
* Возвращает сертификат по отпечатку * Возвращает сертификат по отпечатку

View File

@ -1,10 +1,9 @@
import { Certificate } from './certificate'; import { Certificate } from './certificate';
import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded'; import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';
import { getUserCertificates } from './getUserCertificates'; import { getUserCertificates } from './getUserCertificates';
import {getContainerCertificates} from "./getContainerCertificates"; import { getContainerCertificates } from './getContainerCertificates';
import {getAllUserCertificates} from "./getAllUserCertificates"; import { getAllUserCertificates } from './getAllUserCertificates';
import {getAllContainerCertificates} from "./getAllContainerCertificates"; import { getAllContainerCertificates } from './getAllContainerCertificates';
let certificatesCache: Certificate[]; let certificatesCache: Certificate[];
/** /**
@ -15,7 +14,6 @@ let certificatesCache: Certificate[];
*/ */
export const getCertificates = _afterPluginsLoaded( export const getCertificates = _afterPluginsLoaded(
async (resetCache: boolean = false): Promise<Certificate[]> => { async (resetCache: boolean = false): Promise<Certificate[]> => {
if (!resetCache && certificatesCache) { if (!resetCache && certificatesCache) {
return certificatesCache; return certificatesCache;
} }
@ -41,7 +39,7 @@ export const getCertificates = _afterPluginsLoaded(
while (containerCertificatesCount) { while (containerCertificatesCount) {
foundAvailableCertificate = availableCertificates.find( foundAvailableCertificate = availableCertificates.find(
(cert) => cert.thumbprint === containerCertificates[containerCertificatesCount].thumbprint (cert) => cert.thumbprint === containerCertificates[containerCertificatesCount].thumbprint,
); );
if (!foundAvailableCertificate) { if (!foundAvailableCertificate) {

View File

@ -1,7 +1,7 @@
import { CadesCertificate } from '../api/certificate'; import { CadesCertificate } from '../api/certificate';
import { _afterPluginsLoaded } from './_afterPluginsLoaded'; import { _afterPluginsLoaded } from './_afterPluginsLoaded';
import {_getCadesUserCert} from "./_getCadesUserCert"; import { _getCadesUserCert } from './_getCadesUserCert';
import {_getCadesContainerCert} from "./_getCadesContainerCert"; import { _getCadesContainerCert } from './_getCadesContainerCert';
/** /**
* Возвращает сертификат в формате Cades по отпечатку * Возвращает сертификат в формате Cades по отпечатку
@ -22,5 +22,5 @@ export const _getCadesCert = _afterPluginsLoaded(
} }
return cadesCertificate; return cadesCertificate;
} },
); );

View File

@ -53,7 +53,10 @@ export const _getCadesContainerCert = _afterPluginsLoaded(
} catch (error) { } catch (error) {
console.error(error); console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов из хранилища закрытого ключа'); throw new Error(
_extractMeaningfulErrorMessage(error) ||
'Ошибка получения списка сертификатов из хранилища закрытого ключа',
);
} }
if (!certificatesCount) { if (!certificatesCount) {
@ -76,7 +79,9 @@ export const _getCadesContainerCert = _afterPluginsLoaded(
} catch (error) { } catch (error) {
console.error(error); console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища закрытого ключа'); throw new Error(
_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища закрытого ключа',
);
} }
cadesStore.Close(); cadesStore.Close();

View File

@ -53,7 +53,9 @@ export const _getCadesUserCert = _afterPluginsLoaded(
} catch (error) { } catch (error) {
console.error(error); console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов из хранилища пользователя'); throw new Error(
_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов из хранилища пользователя',
);
} }
if (!certificatesCount) { if (!certificatesCount) {
@ -76,7 +78,9 @@ export const _getCadesUserCert = _afterPluginsLoaded(
} catch (error) { } catch (error) {
console.error(error); console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища пользователя'); throw new Error(
_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища пользователя',
);
} }
cadesStore.Close(); cadesStore.Close();