From 2b8ab994ef8c2ecb8a86de2ef6d2c0cd4834b82d Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Thu, 23 Jun 2022 13:11:08 +0300 Subject: [PATCH] linter fixes --- src/api/getAllCertificates.ts | 10 +++++----- src/api/getCertificate.ts | 8 ++++---- src/api/getCertificates.ts | 16 +++++++--------- src/helpers/_getCadesCert.ts | 10 +++++----- src/helpers/_getCadesContainerCert.ts | 19 ++++++++++++------- src/helpers/_getCadesUserCert.ts | 18 +++++++++++------- 6 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/api/getAllCertificates.ts b/src/api/getAllCertificates.ts index ecce935..158cff3 100755 --- a/src/api/getAllCertificates.ts +++ b/src/api/getAllCertificates.ts @@ -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) { diff --git a/src/api/getCertificate.ts b/src/api/getCertificate.ts index 543a381..476344a 100644 --- a/src/api/getCertificate.ts +++ b/src/api/getCertificate.ts @@ -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'; /** * Возвращает сертификат по отпечатку diff --git a/src/api/getCertificates.ts b/src/api/getCertificates.ts index 3bcdfc2..1f4d7ab 100755 --- a/src/api/getCertificates.ts +++ b/src/api/getCertificates.ts @@ -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 => { - 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) { diff --git a/src/helpers/_getCadesCert.ts b/src/helpers/_getCadesCert.ts index e57bcfb..2b45bd5 100644 --- a/src/helpers/_getCadesCert.ts +++ b/src/helpers/_getCadesCert.ts @@ -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; - } + }, ); diff --git a/src/helpers/_getCadesContainerCert.ts b/src/helpers/_getCadesContainerCert.ts index bfbad7e..7abc8e6 100755 --- a/src/helpers/_getCadesContainerCert.ts +++ b/src/helpers/_getCadesContainerCert.ts @@ -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(); diff --git a/src/helpers/_getCadesUserCert.ts b/src/helpers/_getCadesUserCert.ts index af968ee..c3657b8 100755 --- a/src/helpers/_getCadesUserCert.ts +++ b/src/helpers/_getCadesUserCert.ts @@ -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();