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

@ -1,7 +1,7 @@
import {Certificate} from './certificate';
import {_afterPluginsLoaded} from '../helpers/_afterPluginsLoaded';
import {getAllUserCertificates} from './getAllUserCertificates';
import {getAllContainerCertificates} from './getAllContainerCertificates';
import { Certificate } from './certificate';
import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';
import { getAllUserCertificates } from './getAllUserCertificates';
import { getAllContainerCertificates } from './getAllContainerCertificates';
let certificatesCache: Certificate[];
/**
@ -37,7 +37,7 @@ export const getAllCertificates = _afterPluginsLoaded(
while (containerAllCertificatesCount) {
foundAvailableCertificate = availableCertificates.find(
(cert) => cert.thumbprint === containerAllCertificates[containerAllCertificatesCount].thumbprint
(cert) => cert.thumbprint === containerAllCertificates[containerAllCertificatesCount].thumbprint,
);
if (!foundAvailableCertificate) {

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
import {CadesCertificate} from '../api/certificate';
import {_afterPluginsLoaded} from './_afterPluginsLoaded';
import {_extractMeaningfulErrorMessage} from './_extractMeaningfulErrorMessage';
import {__cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn} from './_generateCadesFn';
import { CadesCertificate } from '../api/certificate';
import { _afterPluginsLoaded } from './_afterPluginsLoaded';
import { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';
import { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from './_generateCadesFn';
/**
* Возвращает сертификат в формате Cades по отпечатку из хранилища закрытого ключа
@ -11,7 +11,7 @@ import {__cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn} from
*/
export const _getCadesContainerCert = _afterPluginsLoaded(
(thumbprint: string): CadesCertificate => {
const {cadesplugin} = window;
const { cadesplugin } = window;
return eval(
_generateCadesFn(function _getCadesCert() {
@ -53,7 +53,10 @@ export const _getCadesContainerCert = _afterPluginsLoaded(
} catch (error) {
console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов из хранилища закрытого ключа');
throw new Error(
_extractMeaningfulErrorMessage(error) ||
'Ошибка получения списка сертификатов из хранилища закрытого ключа',
);
}
if (!certificatesCount) {
@ -76,7 +79,9 @@ export const _getCadesContainerCert = _afterPluginsLoaded(
} catch (error) {
console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища закрытого ключа');
throw new Error(
_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища закрытого ключа',
);
}
cadesStore.Close();

View File

@ -1,7 +1,7 @@
import {CadesCertificate} from '../api/certificate';
import {_afterPluginsLoaded} from './_afterPluginsLoaded';
import {_extractMeaningfulErrorMessage} from './_extractMeaningfulErrorMessage';
import {__cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn} from './_generateCadesFn';
import { CadesCertificate } from '../api/certificate';
import { _afterPluginsLoaded } from './_afterPluginsLoaded';
import { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';
import { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from './_generateCadesFn';
/**
* Возвращает сертификат в формате Cades по отпечатку из хранилища пользователя
@ -11,7 +11,7 @@ import {__cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn} from
*/
export const _getCadesUserCert = _afterPluginsLoaded(
(thumbprint: string): CadesCertificate => {
const {cadesplugin} = window;
const { cadesplugin } = window;
return eval(
_generateCadesFn(function _getCadesCert() {
@ -53,7 +53,9 @@ export const _getCadesUserCert = _afterPluginsLoaded(
} catch (error) {
console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов из хранилища пользователя');
throw new Error(
_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов из хранилища пользователя',
);
}
if (!certificatesCount) {
@ -76,7 +78,9 @@ export const _getCadesUserCert = _afterPluginsLoaded(
} catch (error) {
console.error(error);
throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища пользователя');
throw new Error(
_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата из хранилища пользователя',
);
}
cadesStore.Close();