diff options
Diffstat (limited to 'src/helpers')
-rw-r--r-- | src/helpers/certs-helpers.ts | 9 |
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 @@ | |||
1 | import { readdirSync, readFileSync, ensureDirSync } from 'fs-extra'; | 1 | import { readdirSync, readFileSync, ensureDirSync } from 'fs-extra'; |
2 | import { join } from 'node:path'; | 2 | import { join } from 'node:path'; |
3 | import { userDataCertsPath } from '../environment-remote'; | 3 | import { userDataCertsPath } from '../environment-remote'; |
4 | import { removeNewLines } from '../jsUtils'; | ||
4 | 5 | ||
5 | export function removeNewLines(string: string) { | 6 | export function checkIfCertIsPresent(certData: string): boolean { |
6 | return string.replaceAll(/\r?\n|\r/g, ''); | ||
7 | } | ||
8 | |||
9 | export 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 | } |