aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/certs-helpers.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/helpers/certs-helpers.ts b/src/helpers/certs-helpers.ts
index a81e7e365..a6c83f5c4 100644
--- a/src/helpers/certs-helpers.ts
+++ b/src/helpers/certs-helpers.ts
@@ -1,12 +1,9 @@
1import { readdirSync, readFileSync, ensureDirSync } from 'fs-extra'; 1import { readdirSync, readFileSync, ensureDirSync } from 'fs-extra';
2import { join } from 'node:path'; 2import { join } from 'node:path';
3import { userDataCertsPath } from '../environment-remote'; 3import { userDataCertsPath } from '../environment-remote';
4import { removeNewLines } from '../jsUtils';
4 5
5export function removeNewLines(string: string) { 6export function checkIfCertIsPresent(certData: string): boolean {
6 return string.replaceAll(/\r?\n|\r/g, '');
7}
8
9export function readCerts() {
10 const certsFolder = userDataCertsPath(); 7 const certsFolder = userDataCertsPath();
11 8
12 ensureDirSync(certsFolder); 9 ensureDirSync(certsFolder);
@@ -21,5 +18,5 @@ export function readCerts() {
21 certs.push(removeNewLines(cert)); 18 certs.push(removeNewLines(cert));
22 } 19 }
23 20
24 return certs; 21 return certs.length > 0 && certs.includes(removeNewLines(certData));
25} 22}