* Sanitizes provided server context: * - removes all characters other than a-z, A-Z, 0-9 and `-` * - returns `other` if nothing is provided or the string is empty after sanitization
(serverContext: string)
| 303 | * - returns `other` if nothing is provided or the string is empty after sanitization |
| 304 | */ |
| 305 | function sanitizeServerContext(serverContext: string): string { |
| 306 | const context = serverContext.replace(/[^a-zA-Z0-9\-]/g, ''); |
| 307 | return context.length > 0 ? context : DEFAULT_SERVER_CONTEXT; |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * Bootstraps an application using provided NgModule and serializes the page content to string. |
no test coverage detected