Очистка CommonName от лишних кавычек

This commit is contained in:
Artem Vasilev 2021-03-17 18:15:29 +03:00
parent c0566b7654
commit c0b100ab7f
8 changed files with 8 additions and 8 deletions

2
dist/crypto-pro.js vendored
View File

@ -4088,7 +4088,7 @@ exports._afterPluginsLoaded = function (fn) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports._extractCommonName = function (subjectName) { var _a; return (_a = subjectName.match(/CN=(.+?)(?:,|$)/)) === null || _a === void 0 ? void 0 : _a[1]; }; exports._extractCommonName = function (subjectName) { var _a, _b; return (_b = (_a = subjectName.match(/CN="?(.+?)"?(?:,|$)/)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.replace(/"{2}/g, '"'); };
/***/ }), /***/ }),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3686,7 +3686,7 @@ exports._afterPluginsLoaded = (fn) => {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports._extractCommonName = (subjectName) => { var _a; return (_a = subjectName.match(/CN=(.+?)(?:,|$)/)) === null || _a === void 0 ? void 0 : _a[1]; }; exports._extractCommonName = (subjectName) => { var _a, _b; return (_b = (_a = subjectName.match(/CN="?(.+?)"?(?:,|$)/)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.replace(/"{2}/g, '"'); };
/***/ }), /***/ }),

File diff suppressed because one or more lines are too long

View File

@ -24,6 +24,6 @@ describe('_extractCommonName', () => {
', ', ', ',
); );
expect(_extractCommonName(string)).toBe('"ООО ""Сампо-Сервис"""'); expect(_extractCommonName(string)).toBe('ООО "Сампо-Сервис"');
}); });
}); });

View File

@ -1,2 +1,2 @@
export const _extractCommonName = (subjectName: string): string | undefined => export const _extractCommonName = (subjectName: string): string | undefined =>
subjectName.match(/CN=(.+?)(?:,|$)/)?.[1]; subjectName.match(/CN="?(.+?)"?(?:,|$)/)?.[1]?.replace(/"{2}/g, '"');