feat: lint

This commit is contained in:
Sergey Shehovcov 2024-07-05 10:02:24 +03:00
parent d1a163f823
commit 92a1a8f988
3 changed files with 17 additions and 19 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "crypto-pro-js-m", "name": "crypto-pro-js-m",
"version": "0.1.1", "version": "0.1.2",
"description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/crypto-pro-web/crypto-pro-js", "description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/crypto-pro-web/crypto-pro-js",
"main": "./lib/crypto-pro-js.js", "main": "./lib/crypto-pro-js.js",
"types": "./lib/crypto-pro-js.d.ts", "types": "./lib/crypto-pro-js.d.ts",

View File

@ -79,9 +79,7 @@ export const createDetachedSignature = _afterPluginsLoaded(
const signTypeConst = getSignType(cadesplugin, signType); const signTypeConst = getSignType(cadesplugin, signType);
try { try {
signature = signature = __cadesAsyncToken__ + cadesSignedData.SignHash(cadesHashedData, cadesSigner, signTypeConst);
__cadesAsyncToken__ +
cadesSignedData.SignHash(cadesHashedData, cadesSigner, signTypeConst);
} catch (error) { } catch (error) {
console.error(error); console.error(error);

View File

@ -1,18 +1,18 @@
export type SignType = 'CAdES BES' | 'CAdES-X Long Type 1' | 'CAdES T' | 'PKCS7'; export type SignType = 'CAdES BES' | 'CAdES-X Long Type 1' | 'CAdES T' | 'PKCS7';
export const getSignType = (cadesplugin: any, signType: SignType) => { export const getSignType = (cadesplugin: any, signType: SignType) => {
switch (signType) { switch (signType) {
case 'CAdES BES': { case 'CAdES BES': {
return cadesplugin.CADESCOM_CADES_BES return cadesplugin.CADESCOM_CADES_BES;
};
case 'CAdES-X Long Type 1': {
return cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1;
}
case 'CAdES T': {
return cadesplugin.CADESCOM_CADES_T;
}
case 'PKCS7': {
return cadesplugin.CADESCOM_PKCS7_TYPE;
}
} }
} case 'CAdES-X Long Type 1': {
return cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1;
}
case 'CAdES T': {
return cadesplugin.CADESCOM_CADES_T;
}
case 'PKCS7': {
return cadesplugin.CADESCOM_PKCS7_TYPE;
}
}
};