MCPcopy Index your code
hub / github.com/angular/angular / sanitizeServerContext

Function sanitizeServerContext

packages/platform-server/src/utils.ts:266–269  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

264 * - returns `other` if nothing is provided or the string is empty after sanitization
265 */
266function sanitizeServerContext(serverContext: string): string {
267 const context = serverContext.replace(/[^a-zA-Z0-9\-]/g, '');
268 return context.length > 0 ? context : DEFAULT_SERVER_CONTEXT;
269}
270
271/**
272 * Bootstraps an application using provided NgModule and serializes the page content to string.

Callers 1

appendServerContextInfoFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…