[DURACOM-344] refactor solution to avoid double slashes

This commit is contained in:
FrancescoMolinaro
2025-05-12 17:34:07 +02:00
parent 21ac024423
commit c0e71a0e68
6 changed files with 77 additions and 45 deletions

View File

@@ -55,6 +55,7 @@ import { APP_CONFIG, AppConfig } from './src/config/app-config.interface';
import { extendEnvironmentWithAppConfig } from './src/config/config.util';
import { logStartupMessage } from './startup-message';
import { TOKENITEM } from './src/app/core/auth/models/auth-token-info.model';
import { SsrExcludePatterns } from './src/config/universal-config.interface';
/*
@@ -631,9 +632,11 @@ function start() {
* @param path
* @param excludePathPattern
*/
function isExcludedFromSsr(path: string, excludePathPattern: (string | RegExp)[]): boolean {
return excludePathPattern.some((pattern) => {
const regex = new RegExp(pattern);
function isExcludedFromSsr(path: string, excludePathPattern: SsrExcludePatterns[]): boolean {
const patterns = excludePathPattern.map(p =>
new RegExp(p.pattern, p.flag || '')
);
return patterns.some((regex) => {
return regex.test(path)
});
}